SecurityAction Enumeration
Assembly: mscorlib (in mscorlib.dll)
'Declaration <SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Enumeration SecurityAction 'Usage Dim instance As SecurityAction
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ public enum SecurityAction
SerializableAttribute ComVisibleAttribute(true) public enum SecurityAction
| Member name | Description | |
|---|---|---|
| Assert | The 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 [<topic://cpconassert>]). | |
| Demand | All callers higher in the call stack are required to have been granted the permission specified by the current permission object (see [<topic://cpconmakingsecuritydemands>]). | |
| Deny | The 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 [<topic://cpcondeny>]). | |
| InheritanceDemand | The derived class inheriting the class or overriding a method is required to have been granted the specified permission. For more information, see Inheritance Demands. | |
![]() | LinkDemand | The immediate caller is required to have been granted the specified permission. For more information, see Link Demands. For more information about declarative security and link demands, see [<topic://cpconDeclarativeSecurityUsedWithClassMemberScope>]. |
| PermitOnly | Only the resources specified by this permission object can be accessed, even if the code has been granted permission to access other resources (see [<topic://cpconpermitonly>]). | |
| RequestMinimum | The request for the minimum permissions required for code to run. This action can only be used within the scope of the assembly. | |
| RequestOptional | The 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 | The 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. |
The following table describes the time that each of the security actions takes place and the targets that each supports.
| Declaration of security action | Time of action | Targets supported |
|---|---|---|
| LinkDemand | Just-in-time compilation | Class, Method |
| InheritanceDemand | Load time | Class, Method |
| Demand | Run time | Class, Method |
| Assert | Run time | Class, Method |
| Deny | Run time | Class, Method |
| PermitOnly | Run time | Class, Method |
| RequestMinimum | Grant time | Assembly |
| RequestOptional | Grant time | Assembly |
| RequestRefuse | Grant time | Assembly |
For additional information about attribute targets, see Attribute.
| Topic | Location |
|---|---|
| How to: Request Optional Permissions by Using the RequestOptional Flag | .NET Framework: Security |
| How to: Refuse Permissions by Using the RequestRefuse Flag | .NET Framework: Security |
| How to: Request Minimum Permissions by Using the RequestMinimum Flag | .NET Framework: Security |
| How to: Request Optional Permissions by Using the RequestOptional Flag | .NET Framework: Security |
| How to: Refuse Permissions by Using the RequestRefuse Flag | .NET Framework: Security |
| How to: Request Minimum Permissions by Using the RequestMinimum Flag | .NET Framework: Security |
This example shows how to tell the CLR that code in this assembly requires the IsolatedStoragePermission and also demonstrates how to write and read from isolated storage.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.