Поделиться через


WindowsClaimsPrincipal.IsInRole Метод (SecurityIdentifier)

This class interprets IsInRole as the reflection of whether this principal possesses a claim value whose claim type is specified as the RoleClaimType on a contained Identity or a matching group security identifier.

Пространство имен: Microsoft.IdentityModel.Claims
Сборка: Microsoft.IdentityModel (в microsoft.identitymodel.dll)

Использование

    Dim instance As WindowsClaimsPrincipal
Dim sid As SecurityIdentifier
Dim returnValue As Boolean

returnValue = instance.IsInRole(sid)

Синтаксис

'Декларация
Public Overrides Function IsInRole ( _
    sid As SecurityIdentifier _
) As Boolean
public override bool IsInRole (
    SecurityIdentifier sid
)
public:
virtual bool IsInRole (
    SecurityIdentifier^ sid
) override
public boolean IsInRole (
    SecurityIdentifier sid
)
public override function IsInRole (
    sid : SecurityIdentifier
) : boolean

Параметры

  • sid
    Security Identifier that should be searched for on the contained identities.

Возвращаемое значение

True if a claim is possessed by one of the underlying IClaimsIdentity implementations; otherwise, false.

Исключения

Тип исключений Условие

Безопасность потоков

Любые открытые статические члены (Shared в Visual Basic) этого типа являются поточно-ориентированными.Любые члены экземпляров не являются гарантированно поточно-ориентированными.

Платформы

Платформа разработки

Windows Server 2003, Windows Vista

Target Platforms

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

См. также

Справочник

Класс WindowsClaimsPrincipal
WindowsClaimsPrincipal Члены
Пространство имен Microsoft.IdentityModel.Claims