Extending the RoleProvider GetRolesForUser()

Posted by Farinha on Stack Overflow See other posts from Stack Overflow or by Farinha
Published on 2010-06-03T10:43:58Z Indexed on 2010/06/03 10:44 UTC
Read the original article Hit count: 394

The GetRolesForUser() method in the RoleProvider takes the user login name and returns the list of roles for that user. But in my application this is not enough, I need a few more pieces of information to be able to get the user's roles.

How can I get this extra information into the method?

I have it in the Session, but I found out that Session is not available in the RoleProvider.

What I had in mind was putting this extra info in some class that extends MembershipUser, assuming I can get to it inside the RoleProvider. But I don't know how to create the CustomMembershipUser and make it part of the MembershipProvider. Is this even possible?

The easy way out would be using cookies, but I'm trying to keep away from it.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-membership