System.Web.Security.RolePrincipal Class

Represents security information for the current HTTP request, including role membership. This class cannot be inherited.

See Also: RolePrincipal Members


public sealed class RolePrincipal : System.Security.Principal.IPrincipal


The System.Web.Security.RolePrincipal object implements the System.Security.Principal.IPrincipal interface and represents the current security context for the HTTP request.

When role management is enabled (see System.Web.Security.Roles), the System.Web.Security.RoleManagerModule assigns a System.Web.Security.RolePrincipal object to the System.Web.HttpContext.User property of the System.Web.HttpContext.Current System.Web.HttpContext.

The System.Web.Security.RolePrincipal class exposes the security identity for the current HTTP request and additionally performs checks for role membership. If Roles.CacheRolesInCookie is true, then the System.Web.Security.RolePrincipal object manages the cached list of roles and looks up role membership for the current user in the cached list first, then the role Roles.Provider. If Roles.CacheRolesInCookie is false, the System.Web.Security.RolePrincipal object always looks up role membership using the role provider.

The System.Web.Security.RolePrincipal object encrypts and decrypts role information cached in the cookie identified by the Roles.CookieName based on the Roles.CookieProtectionValue.


Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0