DirectoryServicesPermission DirectoryServicesPermission DirectoryServicesPermission DirectoryServicesPermission Class

定義

DirectoryServicesPermission 類別可讓您控制 System.DirectoryServices 的程式碼存取安全性使用權限。The DirectoryServicesPermission class allows you to control code access security permissions for System.DirectoryServices.

public ref class DirectoryServicesPermission sealed : System::Security::Permissions::ResourcePermissionBase
[System.Serializable]
public sealed class DirectoryServicesPermission : System.Security.Permissions.ResourcePermissionBase
type DirectoryServicesPermission = class
    inherit ResourcePermissionBase
Public NotInheritable Class DirectoryServicesPermission
Inherits ResourcePermissionBase
繼承
屬性

建構函式

DirectoryServicesPermission() DirectoryServicesPermission() DirectoryServicesPermission() DirectoryServicesPermission()

初始化 DirectoryServicesPermission 類別的新執行個體。Initializes a new instance of the DirectoryServicesPermission class.

DirectoryServicesPermission(DirectoryServicesPermissionAccess, String) DirectoryServicesPermission(DirectoryServicesPermissionAccess, String) DirectoryServicesPermission(DirectoryServicesPermissionAccess, String) DirectoryServicesPermission(DirectoryServicesPermissionAccess, String)

使用指定之存取層級和 Active Directory 網域服務節點之指定的路徑,初始化 DirectoryServicesPermission 類別的新執行個體。Initializes a new instance of the DirectoryServicesPermission class with the specified access levels and specified path to an Active Directory Domain Services node.

DirectoryServicesPermission(DirectoryServicesPermissionEntry[]) DirectoryServicesPermission(DirectoryServicesPermissionEntry[]) DirectoryServicesPermission(DirectoryServicesPermissionEntry[]) DirectoryServicesPermission(DirectoryServicesPermissionEntry[])

使用指定的使用權限存取等級項目,初始化 DirectoryServicesPermission 類別的新執行個體。Initializes a new instance of the DirectoryServicesPermission class with the specified permission access level entries.

DirectoryServicesPermission(PermissionState) DirectoryServicesPermission(PermissionState) DirectoryServicesPermission(PermissionState) DirectoryServicesPermission(PermissionState)

使用指定的使用權限狀態,初始化 DirectoryServicesPermission 類別的新執行個體。Initializes a new instance of the DirectoryServicesPermission class with the specified permission state.

屬性

PermissionAccessType PermissionAccessType PermissionAccessType PermissionAccessType

取得或設定一個列舉值,以描述對資源您所授與的存取權類型。Gets or sets an enumeration value that describes the types of access that you are giving the resource.

(Inherited from ResourcePermissionBase)
PermissionEntries PermissionEntries PermissionEntries PermissionEntries

取得這個使用權限的使用權限項目集合。Gets the collection of permission entries for this permission.

TagNames TagNames TagNames TagNames

取得或設定一個字串陣列,以辨識您要保護的資源。Gets or sets an array of strings that identify the resource you are protecting.

(Inherited from ResourcePermissionBase)

方法

AddPermissionAccess(ResourcePermissionBaseEntry) AddPermissionAccess(ResourcePermissionBaseEntry) AddPermissionAccess(ResourcePermissionBaseEntry) AddPermissionAccess(ResourcePermissionBaseEntry)

將使用權限項目加入至使用權限。Adds a permission entry to the permission.

(Inherited from ResourcePermissionBase)
Assert() Assert() Assert() Assert()

宣告即使堆疊中較高層的呼叫端未獲得資源存取權限,呼叫程式碼仍可透過呼叫這個方法的程式碼要求權限,來存取受保護的資源。Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. 使用 Assert() 可能會造成安全性問題。Using Assert() can create security issues.

(Inherited from CodeAccessPermission)
Clear() Clear() Clear() Clear()

清除已加入的使用權限項目中的使用權限。Clears the permission of the added permission entries.

(Inherited from ResourcePermissionBase)
Copy() Copy() Copy() Copy()

建立並傳回目前使用權限物件的相同複本。Creates and returns an identical copy of the current permission object.

(Inherited from ResourcePermissionBase)
Demand() Demand() Demand() Demand()

如果呼叫堆疊中所有較高層的呼叫端尚未授與目前執行個體 (Instance) 所指定的使用權限,請於執行階段強制執行 SecurityExceptionForces a SecurityException at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

(Inherited from CodeAccessPermission)
Deny() Deny() Deny() Deny()

防止呼叫堆疊中較高層的呼叫端,使用呼叫這個方法的程式碼來存取目前執行個體所指定的資源。Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

(Inherited from CodeAccessPermission)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的 CodeAccessPermission 物件是否等於目前的 CodeAccessPermissionDetermines whether the specified CodeAccessPermission object is equal to the current CodeAccessPermission.

(Inherited from CodeAccessPermission)
FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement) FromXml(SecurityElement)

透過 XML 編碼,重新建構具有指定狀態的安全性物件。Reconstructs a security object with a specified state from an XML encoding.

(Inherited from ResourcePermissionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

取得 CodeAccessPermission 物件的雜湊碼,其適合用於雜湊表這類的雜湊演算法和資料結構。Gets a hash code for the CodeAccessPermission object that is suitable for use in hashing algorithms and data structures such as a hash table.

(Inherited from CodeAccessPermission)
GetPermissionEntries() GetPermissionEntries() GetPermissionEntries() GetPermissionEntries()

傳回已加入至這個使用權限的 ResourcePermissionBaseEntry 物件陣列。Returns an array of the ResourcePermissionBaseEntry objects added to this permission.

(Inherited from ResourcePermissionBase)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
Intersect(IPermission) Intersect(IPermission) Intersect(IPermission) Intersect(IPermission)

建立並傳回目前使用權限物件和目標使用權限物件交集的使用權限物件。Creates and returns a permission object that is the intersection of the current permission object and a target permission object.

(Inherited from ResourcePermissionBase)
IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission) IsSubsetOf(IPermission)

判斷目前使用權限物件是否為指定使用權限的子集。Determines whether the current permission object is a subset of the specified permission.

(Inherited from ResourcePermissionBase)
IsUnrestricted() IsUnrestricted() IsUnrestricted() IsUnrestricted()

取得值,表示使用權限是否不受限制。Gets a value indicating whether the permission is unrestricted.

(Inherited from ResourcePermissionBase)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
PermitOnly() PermitOnly() PermitOnly() PermitOnly()

防止呼叫堆疊中較高層的呼叫端,使用呼叫這個方法的程式碼來存取除了目前執行個體所指定資源之外的所有資源。Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance.

(Inherited from CodeAccessPermission)
RemovePermissionAccess(ResourcePermissionBaseEntry) RemovePermissionAccess(ResourcePermissionBaseEntry) RemovePermissionAccess(ResourcePermissionBaseEntry) RemovePermissionAccess(ResourcePermissionBaseEntry)

從使用權限中移除使用權限項目。Removes a permission entry from the permission.

(Inherited from ResourcePermissionBase)
ToString() ToString() ToString() ToString()

建立並傳回目前使用權限物件的字串表示。Creates and returns a string representation of the current permission object.

(Inherited from CodeAccessPermission)
ToXml() ToXml() ToXml() ToXml()

建立並傳回安全性物件的 XML 編碼方式和目前狀態。Creates and returns an XML encoding of the security object and its current state.

(Inherited from ResourcePermissionBase)
Union(IPermission) Union(IPermission) Union(IPermission) Union(IPermission)

建立將目前使用權限物件和目標使用權限物件相結合的使用權限物件。Creates a permission object that combines the current permission object and the target permission object.

(Inherited from ResourcePermissionBase)

明確介面實作

IPermission.Demand() IPermission.Demand() IPermission.Demand() IPermission.Demand() Inherited from CodeAccessPermission
IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() IStackWalk.Assert() Inherited from CodeAccessPermission
IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() IStackWalk.Demand() Inherited from CodeAccessPermission
IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() IStackWalk.Deny() Inherited from CodeAccessPermission
IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() IStackWalk.PermitOnly() Inherited from CodeAccessPermission

欄位

Any Any Any Any

指定用來表示任何萬用字元 (Wildcard Character) 的字元。Specifies the character to be used to represent the any wildcard character.

(Inherited from ResourcePermissionBase)
Local Local Local Local

指定用來表示區域參考的字元。Specifies the character to be used to represent a local reference.

(Inherited from ResourcePermissionBase)

適用於

另請參閱