Caution
Code Access Security is not supported or honored by the runtime.
Specifies the security actions that can be performed using declarative security.
public enum class SecurityAction
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum SecurityAction
public enum SecurityAction
[System.Serializable]
public enum SecurityAction
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum SecurityAction
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SecurityAction =
type SecurityAction =
[<System.Serializable>]
type SecurityAction =
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SecurityAction =
Public Enum SecurityAction
All callers higher in the call stack are required to have been granted the permission specified by the current permission object.
Assert 3The calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource (see Using the Assert Method).
Deny 4The ability to access the resource specified by the current permission object is denied to callers, even if they have been granted permission to access it (see Using the Deny Method).
PermitOnly 5Only the resources specified by this permission object can be accessed, even if the code has been granted permission to access other resources.
LinkDemand 6The immediate caller is required to have been granted the specified permission. Do not use in the .NET Framework 4. For full trust, use SecurityCriticalAttribute instead; for partial trust, use Demand.
InheritanceDemand 7The derived class inheriting the class or overriding a method is required to have been granted the specified permission.
RequestMinimum 8The request for the minimum permissions required for code to run. This action can only be used within the scope of the assembly.
RequestOptional 9The request for additional permissions that are optional (not required to run). This request implicitly refuses all other permissions not specifically requested. This action can only be used within the scope of the assembly.
RequestRefuse 10The request that permissions that might be misused will not be granted to the calling code. This action can only be used within the scope of the assembly.
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.
The following table describes the time that each security action takes place and the targets that it supports.
Important
In .NET Framework 4, runtime support has been removed for enforcing the Deny, RequestMinimum, RequestOptional, and RequestRefuse permission requests. These requests should not be used in code that is based on .NET Framework 4 or later. For more information about this and other changes, see Security Changes.
You should not use LinkDemand
in .NET Framework 4. Instead, use the SecurityCriticalAttribute to restrict usage to fully trusted applications, or use Demand
to restrict partially trusted callers.
LinkDemand
(do not use in .NET Framework 4+) Just-in-time compilation Class, method InheritanceDemand
Load time Class, method Demand
Run time Class, method Assert
Run time Class, method Deny
(obsolete in .NET Framework 4) Run time Class, method PermitOnly
Run time Class, method RequestMinimum
(obsolete in .NET Framework 4) Grant time Assembly RequestOptional
(obsolete in .NET Framework 4) Grant time Assembly RequestRefuse
(obsolete in .NET Framework 4) Grant time Assembly
For additional information about attribute targets, see Attribute.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this articleWas this page helpful?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4