PermissionState PermissionState PermissionState PermissionState Enum

定义

指定权限在创建时是否对资源有所有访问权限或没有任何访问权限。Specifies whether a permission should have all or no access to resources at creation.

public enum class PermissionState
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum PermissionState
type PermissionState = 
Public Enum PermissionState
继承
PermissionStatePermissionStatePermissionStatePermissionState
属性

字段

None None None None 0

不能对该权限所保护的资源进行访问。No access to the resource protected by the permission.

Unrestricted Unrestricted Unrestricted Unrestricted 1

可以对该权限所保护的资源进行完全访问。Full access to the resource protected by the permission.

注解

可以在完全受限或完全不受限状态中创建的权限。Permissions can be created in either a totally restrictive or totally unrestrictive state. 完全不受限状态允许资源; 不能访问完全不受限制的状态允许对特定资源的所有访问。A totally restrictive state allows no access to resources; a totally unrestricted state allows all access to a particular resource. 例如,文件权限构造函数可以创建一个不表示任何访问的任何文件或对所有文件的所有访问的对象。For example, the file permission constructor could create an object representing either no access to any files or all access to all files.

每种类型的权限清楚地定义极端的状态,表示所有或者没有任何参数的类型中可表示的权限。Each type of permission clearly defines extreme states representing either all or none of the permissions expressible within the type. 因此,就可以在完全受限制或不受限制状态不知情的情况下的特定权限; 中创建通用的权限但是,可以仅设置中间状态,根据特定权限语义。Thus, it is possible to create a generic permission in a completely restricted or unrestricted state without knowledge of the particular permission; however, intermediate states can only be set according to the specific permission semantics.

.NET Framework 中实现的所有代码访问权限可能都需要PermissionState作为其构造函数的参数的值。All code access permissions implemented in the .NET Framework can take a PermissionState value as an argument to their constructor.

适用于