ASP.NET user roles

  • Thread starter Thread starter JKJ
  • Start date Start date
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?
 
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

Similar Threads

NHibernate QueryOver with Many-to-Many 0
Intersection of Lists 5
MVC Web-API - token based authentication 2
role class for windows form 3
List to EntityCollection 0
List<String> 15
Generics 7
Find Ints in List ... 4

Back
Top