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()

如果未给调用堆栈中处于较高位置的所有调用方授予当前实例所指定的权限,则在运行时强制 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 的浅表副本。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

指定要用来表示任何通配符的字符。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)

适用于

另请参阅