How to determine authorized roles for a page?

M

MyndPhlyp

I've been combing through Google trying to find the answer but not luck.

I'm using Forms authentication. Determining what Roles the current user is
in was the easy part. But how does one determine what Roles are permitted to
use a particular ASPX page? (.NET 2.0, VS05)
 
D

Dominick Baier

you can do do that using the <authorization> element in web.config - or imperatively
usign Page.User.IsInRole to grant/deny access to a page.
 
G

Guest

you can do do that using the <authorization> element in web.config - or imperatively
usign Page.User.IsInRole to grant/deny access to a page.

He need to determine what Roles are permitted to use the page.
 
M

MyndPhlyp

Dominick Baier said:
you can do do that using the <authorization> element in web.config - or imperatively
usign Page.User.IsInRole to grant/deny access to a page.

Dom:

Thanks. Got that part already. As Alexey said, I need to determine what
Roles are permitted to access a page.
 
D

Dominick Baier

Where is this information stored? In the web.config??

If yes you can use the config API to parse it.


this:
AuthorizationSection section = (AuthorizationSection)Context.GetSection("system.web/authorization");

should get you started.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top