Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Location element in the Web.config file. Allow System Admin whole directory, allow others specific page

Reply
Thread Tools

Location element in the Web.config file. Allow System Admin whole directory, allow others specific page

 
 
Ryan Taylor
Guest
Posts: n/a
 
      09-09-2004
Hello.

I am developing an ASP.net C# application using forms authentication. I have
a directory ManageUsers and I want all pages in that directory to be
accessed by the system administrator. But, there is one page,
ChangePassword.aspx that any authenticated user should be able to access.

How exactly does the location element assign permissions to directories and
pages? I thought that permissions would be applied in the order that the
location elements were defined in the web.config file. With the latest
location element defining the permissions.

The following is what I have attempted. But when the Change Password role is
assigned to the user, he/she is able to view all pages in the ManageUsers
directory and not just the ManageUsers/ChangePassword.aspx

<location path="ManageUsers" allowOverride="false">
<system.web>
<authorization>
<allow roles="System Administrator, Requesting Organization
Administrator, Responding Organization Administrator" />
<deny users="?" />
</authorization>
</system.web>
</location>

<location path="ManageUsers/ChangePassword.aspx" allowOverride="false">
<system.web>
<authorization>
<allow roles="Change Password, System Administrator, Requesting
Organization Administrator, Requesting Organization User, Responding
Organization Administrator, Responding Organization User" />
<deny users="?" />
</authorization>
</system.web>
</location>


Thanks in advance for any assistance.
Ryan Taylor


 
Reply With Quote
 
 
 
 
Ryan Taylor
Guest
Posts: n/a
 
      09-09-2004
I found that part of my problem was that I was allowing all authenticated
users access to the pages. So I replaced the '?' with a '*' and this solved
the problem I also moved the ChangePassword.aspx file to its own location
just to be thorough.

Ryan Taylor


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent : Direct Client is looking for Informatica Admin &Developer(Admin must) sarah Fernandes Java 0 11-01-2010 05:03 PM
XML parsing problem finding a specific element in a specific place mazdotnet ASP .Net 2 10-02-2009 10:07 AM
Location, location, location =?Utf-8?B?VHJhY2V5?= Wireless Networking 2 02-17-2007 08:37 PM
Rails: generate scaffold Product Admin overwrites admin pages Phlip Ruby 1 09-15-2006 09:40 PM
*WITHOUT* using: ValidateRequest="False" for the whole page (or my whole site).... \A_Michigan_User\ ASP .Net 2 08-21-2006 02:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57