Is it a good idea to keep the user's role together with his name, for example with setAuthCookie
, do you:
formsAuthSrv.SetAuthCookie(strUser+strRole);
and you can do your own roles provider like this:
public class MyRoleProvider : RoleProvider
{
public override string[] GetRolesForUser(string username)
{
// get the roles from username and return it as an string[]
..
return new string[] { role };
}
}
and when you call user.identity.name
you have to split it to get just the username
Is there a better alternative?