RolePrincipal Class

 

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

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Security.Claims.ClaimsPrincipal
    System.Web.Security.RolePrincipal

[SerializableAttribute]
public class RolePrincipal : ClaimsPrincipal, ISerializable

NameDescription
System_CAPS_pubmethodRolePrincipal(IIdentity)

Instantiates a RolePrincipal object for the specified identity.

System_CAPS_pubmethodRolePrincipal(IIdentity, String)

Instantiates a RolePrincipal object for the specified identity with role information from the specified encryptedTicket.

System_CAPS_protmethodRolePrincipal(SerializationInfo, StreamingContext)

Initializes a new instance of the RolePrincipal class using information that is contained in the specified SerializationInfo object and using the specified streaming context.

System_CAPS_pubmethodRolePrincipal(String, IIdentity)

Instantiates a RolePrincipal object for the specified identity using the specified providerName.

System_CAPS_pubmethodRolePrincipal(String, IIdentity, String)

Instantiates a RolePrincipal object for the specified identity using the specified providerName and role information from the specified encryptedTicket.

NameDescription
System_CAPS_pubpropertyCachedListChanged

Gets a value indicating whether the list of role names cached with the RolePrincipal object has been modified.

System_CAPS_pubpropertyClaims

Gets a collection that contains all of the claims from all of the claims identities associated with this claims principal.(Inherited from ClaimsPrincipal.)

System_CAPS_pubpropertyCookiePath

Gets the path for the cached role names cookie.

System_CAPS_protpropertyCustomSerializationData

(Inherited from ClaimsPrincipal.)

System_CAPS_pubpropertyExpired

Gets a value indicating whether the roles cookie has expired.

System_CAPS_pubpropertyExpireDate

Gets the date and time when the roles cookie will expire.

System_CAPS_pubpropertyIdentities

Gets a collection that contains all of the claims identities associated with this claims principal.(Inherited from ClaimsPrincipal.)

System_CAPS_pubpropertyIdentity

Gets the security identity for the current HTTP request.(Overrides ClaimsPrincipal.Identity.)

System_CAPS_pubpropertyIsRoleListCached

Gets a value indicating whether the list of roles for the user has been cached in a cookie.

System_CAPS_pubpropertyIssueDate

Gets the date and time that the roles cookie was issued.

System_CAPS_pubpropertyProviderName

Gets the name of the role provider that stores and retrieves role information for the user.

System_CAPS_pubpropertyVersion

Gets the version number of the roles cookie.

NameDescription
System_CAPS_pubmethodAddIdentities(IEnumerable<ClaimsIdentity>)

Adds the specified claims identities to this claims principal.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodAddIdentity(ClaimsIdentity)

Adds the specified claims identity to this claims principal.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodClone()

Returns a copy of this instance.(Inherited from ClaimsPrincipal.)

System_CAPS_protmethodCreateClaimsIdentity(BinaryReader)

Creates a new claims identity.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFindAll(Predicate<Claim>)

Retrieves all of the claims that are matched by the specified predicate.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodFindAll(String)

Retrieves all or the claims that have the specified claim type.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodFindFirst(Predicate<Claim>)

Retrieves the first claim that is matched by the specified predicate.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodFindFirst(String)

Retrieves the first claim with the specified claim type.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_protmethodGetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo object with the data that is required in order to serialize the target object using the specified streaming context.(Overrides ClaimsPrincipal.GetObjectData(SerializationInfo, StreamingContext).)

System_CAPS_pubmethodGetRoles()

Gets a list of roles that the RolePrincipal is a member of.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodHasClaim(Predicate<Claim>)

Determines whether any of the claims identities associated with this claims principal contains a claim that is matched by the specified predicate.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodHasClaim(String, String)

Determines whether any of the claims identities associated with this claims principal contains a claim with the specified claim type and value.(Inherited from ClaimsPrincipal.)

System_CAPS_pubmethodIsInRole(String)

Gets a value indicating whether the user represented by the RolePrincipal is in the specified role.(Overrides ClaimsPrincipal.IsInRole(String).)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSetDirty()

Marks the cached role list as having been changed.

System_CAPS_pubmethodToEncryptedTicket()

Returns the role information cached with the RolePrincipal object encrypted based on the CookieProtectionValue.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodWriteTo(BinaryWriter)

(Inherited from ClaimsPrincipal.)

System_CAPS_protmethodWriteTo(BinaryWriter, Byte[])

(Inherited from ClaimsPrincipal.)

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

When role management is enabled (see Roles), the RoleManagerModule assigns a RolePrincipal object to the User property of the CurrentHttpContext.

The RolePrincipal class exposes the security identity for the current HTTP request and additionally performs checks for role membership. If CacheRolesInCookie is true, then the 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 Provider. If CacheRolesInCookie is false, the RolePrincipal object always looks up role membership using the role provider.

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

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: