IPrincipal IPrincipal IPrincipal IPrincipal Interface

定义

定义用户对象的基本功能。Defines the basic functionality of a principal object.

public interface class IPrincipal
[System.Runtime.InteropServices.ComVisible(true)]
public interface IPrincipal
type IPrincipal = interface
Public Interface IPrincipal
派生
属性

注解

主体对象表示运行代码的用户的安全上下文, 包括该用户的标识 (IIdentity) 及其所属的任何角色。A principal object represents the security context of the user on whose behalf the code is running, including that user's identity (IIdentity) and any roles to which they belong.

需要所有主体对象来实现IPrincipal接口。All principal objects are required to implement the IPrincipal interface. 有关IPrincipal实现的详细信息, ClaimsPrincipal请参阅类。For more information about IPrincipal implementations, see the ClaimsPrincipal class.

属性

Identity Identity Identity Identity

获取当前用户的标识。Gets the identity of the current principal.

方法

IsInRole(String) IsInRole(String) IsInRole(String) IsInRole(String)

确定当前用户是否属于指定的角色。Determines whether the current principal belongs to the specified role.

适用于