View Single Post
  #3 (permalink)  
Old 07-23-2007, 08:50 AM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 173
Default

Sorry, I realize I didn't actually answer your question about roles...

To manage user roles and find out what roles a user is in, use static methods on the RoleManager class, which is in the Checkbox.Security namespace.

Code:
//List names of roles a user is in
public static string[] GetRoles(IIdentity identity);


//Get the database ID of a role 
public static int GetRoleID(string roleName);

//Associate a user with a role
public static void AddIdentityRole(IIdentity identity, int roleID);

//Remove the association between a user and a role
public static void RemoveIdentityRole(IIdentity identity, int roleID)
Reply With Quote