編集

次の方法で共有


SecurityPermissionFlag Enum

Definition

Caution

Code Access Security is not supported or honored by the runtime.

Specifies access flags for the security permission object.

This enumeration supports a bitwise combination of its member values.

public enum class SecurityPermissionFlag
[System.Flags]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum SecurityPermissionFlag
[System.Flags]
public enum SecurityPermissionFlag
[System.Flags]
[System.Serializable]
public enum SecurityPermissionFlag
[System.Flags]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum SecurityPermissionFlag
[<System.Flags>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SecurityPermissionFlag = 
[<System.Flags>]
type SecurityPermissionFlag = 
[<System.Flags>]
[<System.Serializable>]
type SecurityPermissionFlag = 
[<System.Flags>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SecurityPermissionFlag = 
Public Enum SecurityPermissionFlag
Inheritance
SecurityPermissionFlag
Attributes

Fields

Name Value Description
NoFlags 0

No security access.

Assertion 1

Ability to assert that all this code's callers have the requisite permission for the operation.

UnmanagedCode 2

Ability to call unmanaged code.

Since unmanaged code potentially allows other permissions to be bypassed, this is a dangerous permission that should only be granted to highly trusted code. It is used for such applications as calling native code using PInvoke or using COM interop.

SkipVerification 4

Ability to skip verification of code in this assembly. Code that is unverifiable can be run if this permission is granted.

This is a powerful permission that should be granted only to highly trusted code.

This flag has no effect when used dynamically with stack modifiers such as Deny(), Assert(), and PermitOnly().

Execution 8

Permission for the code to run. Without this permission, managed code will not be executed.

This flag has no effect when used dynamically with stack modifiers such as Deny(), Assert(), and PermitOnly().

ControlThread 16

Ability to use certain advanced operations on threads.

ControlEvidence 32

Ability to provide evidence, including the ability to alter the evidence provided by the common language runtime.

This is a powerful permission that should only be granted to highly trusted code.

ControlPolicy 64

Ability to view and modify policy.

This is a powerful permission that should only be granted to highly trusted code.

SerializationFormatter 128

Ability to provide serialization services. Used by serialization formatters.

ControlDomainPolicy 256

Ability to specify ___domain policy.

ControlPrincipal 512

Ability to manipulate the principal object.

ControlAppDomain 1024

Ability to create and manipulate an AppDomain.

RemotingConfiguration 2048

Permission to configure Remoting types and channels.

Infrastructure 4096

Permission to plug code into the common language runtime infrastructure, such as adding Remoting Context Sinks, Envoy Sinks and Dynamic Sinks.

BindingRedirects 8192

Permission to perform explicit binding redirection in the application configuration file. This includes redirection of .NET assemblies that have been unified as well as other assemblies found outside .NET.

AllFlags 16383

The unrestricted state of the permission.

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

This enumeration is used by SecurityPermission.

Caution

Many of these flags are powerful and should only be granted to highly trusted code.

Applies to

See also