ASP.NET user roles

J

JKJ

After I assign a role to a user how can I read what role
the user is in later on other than checking User.IsInRole
()? Is there a way to directly read the user's current
role as a string value?
 
J

Juliano Bortolozzi

Hello,
Sorry, but, as I know, the default interface allows you only to "ask" if
the user is in an specified role. If you want to override this behavior than
you must write your own principal class.

If you had set windows authentication in your web.config file, there is a
role collection in the WindowsPrincipal object that you can see when
debuging, but I guess it's private and you don't have access to it. It is
lazy created, so it's only loaded after your first call to IsInRole.


Juliano
 

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

Top