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
 
Back
Top