IPrincipal.IsInRole(String) 方法

定义

确定当前用户是否属于指定的角色。

public:
 bool IsInRole(System::String ^ role);
public bool IsInRole (string role);
abstract member IsInRole : string -> bool
Public Function IsInRole (role As String) As Boolean

参数

role
String

要检查其成员资格的角色的名称。

返回

Boolean

如果当前用户是指定角色的成员,则为 true;否则为 false

适用于