Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5981195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:54:35+00:00 2026-05-22T21:54:35+00:00

I have an location element in my web.config like so: <location path=Admin> <system.web> <authorization>

  • 0

I have an location element in my web.config like so:

<location path="Admin">
    <system.web>
        <authorization>
            <allow roles="Domain\Development"/>
            <deny users="*" />
        </authorization>
    </system.web>
</location>

This works to only allow members of the development group access to this folder.

I was wondering if there is a way to simply test if a user has access to this folder?

One scenario is creating menu items. I’d simply like to hide or not render links to pages in this folder if the user does not have the proper rights.

Is there a way to do this in code. I don’t want to have to hard code a check for membership in Domain\Development rather I’d like to use asp.net to tell me if this current user has access.

This would be nice if the rules get more complicated etc. Also having this in one place enforces DRY (Don’t Repeat Yourself).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:54:36+00:00Added an answer on May 22, 2026 at 9:54 pm

    Through a related question I found the answer. Call UrlAuthorizationModule.CheckUrlAccessForPrincipal. (Documentation is here.) You can give it a path and a user (such as Page.User for the current user), and it will tell you if the user can access that path.

    I like this for exactly the reason you mentioned: You can put your access logic in one place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in my web.config: <location path=RestrictedPage.aspx> <system.web> <authorization> <allow roles=Group1Admin, Group3Admin,
In my ASP.NET's Web Config file I have the following location elements defined: <location
I have the following section added to my web.config: <system.webServer> <caching> <profiles> <add extension=.html
I have table with 50 entries (users with such details like Name Surname Location
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,
Assume I have the following in my web.config (most of the file omitted for
In my system I have a main page, that when clicking on any element
I have given a location defined by latitude and longitude. Now i want to
I have this rewrite rule RewriteEngine On RewriteBase /location/ RewriteRule ^(.+)/?$ index.php?franchise=$1 Which is
We have a JavaScript function named move which does just windows.location.href = any given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.