An easy way to do this is to keep the list of roles in the authentication ticket for user authentication. Then, for each request ( Application_AuthenticateRequestthe global.asax file method), you retrieve the roles, add them to the object, GenericPrincipaland set the property Httpcontext.User.
Yours User.IsInRole("role")and [AuthorizeAttribute(Roles="role")]will work as usual.
For more on how to do this, see this answer .
source
share