Re: check if user is the one specified in <location path="...



now I'm able to check the logged user name, but I need to compare it to the
one stored in <location path=....
<allow users='john'........

so, in the "Default.aspx" page, which is available to anybody (not only
'John',....),
I wrote:
Dim _as_ As Web.Configuration.AuthorizationSection =
Web.Configuration.WebConfigurationManager.GetSection("system.web/authorization", "~/Administration")

but I'm getting this error:
"The attribute 'users' has been locked in a higher level configuration"

I understand that accessing the config file in an already protected folder
from an unprotected page sound non-sense, but is there a way to work around
this ?

thanks for help


"Joe Kaplan" wrote:

The identity information that the UrlAuthorizationModule (the thing taht
consumes that particular piece of XML web.config) examines the
HttpContext.User property, specifically the .Identity.Name property and the
..IsInRole method to compare against user name and role membership, so you
can do the same thing programmatically in your code to conditionally display
specific markup.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
"zino66" <zino66@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BA914AEF-61C7-4892-B5E3-0512D7780098@xxxxxxxxxxxxxxxx
In an intranet asp.net application I have the following in the web config:

<authentication mode="Windows" />

<location path="AdministrationFolder">
<system.web>
<authorization>
<allow users="John"/>
<allow users="David"/>
<allow users="Eric"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

The "Default.aspx" page is accessible to everybody.
I have a link <a href=Administration.aspx>Administration</a> on this page,
which I need it to be visible only if the user is one of those specified
in
"<location path=....>" (If user = in (John, David, Eric) then, display
the
link.)



How can I check if the logged user is one of the mentioned users above ?



.

.