read web.config users authorized for a cerrtain path

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

hi ng,

i'd like to add control elements on a page, but only for users that are
authotized to access a certain location, defined in web.config.
my question:
is it possible to read the <allow users="" /> section of a <location> in
web.config, or do i have to add these users as key-value elements that
can be accessed by AppSetting... ?
i didn't find another solution, but that way is very unconfortable in a
environment with many users.

thanks very much in advance for your help.

dan
 
Dan,

allow users only allow users to access the application, so you can put
conditional code to check for those users using User.Identity.Name and read
those user preferences through Appsettings element.

Let me know if you need anything else.

regards
Joyjit
 
hi joyjit,

thanks for your help.
i wanted to avoid to add the users that are allowed to access a certain
location twice: to the
<location path="path"> <system.web> section AND
to the appsettings.
the control elements lead to the restricted area, so only users allowed
to go there shall see the elements (buttons).
so, can i check User.Identity.Name against a location section in web.config?

regards,
daniel
 
Back
Top