Compartir a través de


ClaimsPrincipal.IsInRole (Método)

This class interprets IsInRole as the reflection of whether this principal possesses a claim specified by a configured list. The claim value has no bearing on the result.

Espacio de nombres: Microsoft.IdentityModel.Claims
Ensamblado: Microsoft.IdentityModel (en microsoft.identitymodel.dll)

Uso

    Dim instance As ClaimsPrincipal
Dim role As String
Dim returnValue As Boolean

returnValue = instance.IsInRole(role)

Sintaxis

'Declaración
Public Function IsInRole ( _
    role As String _
) As Boolean
public bool IsInRole (
    string role
)
public:
virtual bool IsInRole (
    String^ role
) sealed
public final boolean IsInRole (
    String role
)
public final function IsInRole (
    role : String
) : boolean

Parámetros

  • role
    The claim type of the role to check for.

Valor devuelto

Returns Boolean. true if a claim with the specified type exists; otherwise, false.

Seguridad para subprocesos

Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para subprocesos.No se garantiza que los miembros de instancias sean seguros para subprocesos.

Plataformas

Plataformas de desarrollo

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

Vea también

Referencia

ClaimsPrincipal (Clase)
ClaimsPrincipal (Miembros)
Microsoft.IdentityModel.Claims (Espacio de nombres)