ClientRolePrincipal Class
Represents security information for client application services, which includes role information.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
| Name | Description | |
|---|---|---|
![]() | ClientRolePrincipal(IIdentity) | Initializes a new instance of the ClientRolePrincipal class. |
| Name | Description | |
|---|---|---|
![]() | Identity | Gets the security identity associated with the ClientRolePrincipal. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | IsInRole(String) | Gets a value indicating whether the user represented by the ClientRolePrincipal is in the specified role. |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
When you validate a user in client application services, the ClientFormsAuthenticationMembershipProvider or the ClientWindowsAuthenticationMembershipProvider sets the static Thread.CurrentPrincipal property to an instance of this class. The ClientFormsAuthenticationMembershipProvider initializes the Identity property to a new instance of the ClientFormsIdentity class. The ClientWindowsAuthenticationMembershipProvider initializes the Identity property to the WindowsIdentity object returned by the static WindowsIdentity.GetCurrent() method.
You will not typically access this class directly. Normally, you will call the IsInRole method of the IPrincipal returned by the static CurrentPrincipal property. However, you can cast the CurrentPrincipal property value to a ClientRolePrincipal reference to call the IsInRole method explicitly, as demonstrated in the Example section.
Available since 3.5
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


