IPrincipal 介面

定義

定義主體物件的基本功能。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
衍生
屬性

備註

Principal 物件代表執行程式碼之使用者的安全性內容,包括該使用者的身分識別(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

取得目前主要物件的識別。Gets the identity of the current principal.

方法

IsInRole(String)

判斷目前的原則物件是否屬於指定的角色。Determines whether the current principal belongs to the specified role.

適用於