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.

适用于