System.Security.Permissions.SecurityAction Enum

public enum SecurityAction

Base Types

Object
  ValueType
    Enum
      SecurityAction

Assembly

mscorlib

Library

BCL

Summary

Specifies security actions that can be performed using declarative security.

Description

[Note: For information about using declarative security and security actions, see Partition II of the CLI Specification.]

[Note: Declarative security is specified using types derived from SecurityAttribute. The following table describes the attribute targets supported by each of the security actions.

Security actionAttribute Targets
AssertClass, Method
DemandClass, Method
DenyClass, Method
InheritanceDemandClass, Method
LinkDemandClass, Method
PermitOnlyClass, Method
RequestMinimumAssembly
RequestOptionalAssembly
RequestRefuseAssembly
For additional information on attribute targets, see Attribute.

]

See Also

System.Security.Permissions Namespace

Members

SecurityAction Fields

SecurityAction.Assert Field
SecurityAction.Demand Field
SecurityAction.Deny Field
SecurityAction.InheritanceDemand Field
SecurityAction.LinkDemand Field
SecurityAction.PermitOnly Field
SecurityAction.RequestMinimum Field
SecurityAction.RequestOptional Field
SecurityAction.RequestRefuse Field
SecurityAction.value__ Field


SecurityAction.Assert Field

Assert = 3;

Summary

Specifies that callers of the code performing the assert need not have the permissions specified by the current security attribute, and that a check for any such permission can stop after the code that asserted it. [Note: An assert can change the default behavior of a security check (such as that caused by a Demand, LinkDemand, etc.).]

This action can be applied to classes and methods.

[Note: This action should only be used by code that can assure that its callers cannot manipulate it to abuse the asserted permission.]

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.Demand Field

Demand = 2;

Summary

Specified that all callers are required to have the permissions specified by the current security attribute.

This action can be applied to classes and methods.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.Deny Field

Deny = 4;

Summary

Specifies that access to the resource or operation described by the current security attribute be denied to callers, even if they have been granted permission to access it. [Note: System.Security.Permissions.SecurityAction.Deny causes a security check for the permissions specified by the current security attribute to fail even when it would otherwise succeed.]

This action can be applied to classes and methods.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.InheritanceDemand Field

InheritanceDemand = 7;

Summary

Specifies the permissions that a derived class is required to have. When the target is a class, classes inheriting from the target are required to have the permissions specified by the current security attribute. When the target is a method, classes overriding the target are required to have the permissions specified by the current security attribute.

This action can be applied to classes and methods.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.LinkDemand Field

LinkDemand = 6;

Summary

Specifies that the immediate caller be required to have the specified permissions.

This action can be applied to classes and methods.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.PermitOnly Field

PermitOnly = 5;

Summary

Specifies that access is limited to only those resources or operations specified by the current security attribute, even if the code has been granted permission to access others. A security check for a permission not described by the current security attribute fails regardless of whether or not callers have been granted this permission.

This action can be applied to classes and methods.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.RequestMinimum Field

RequestMinimum = 8;

Summary

Specifies that the current security attribute describes the minimum permissions required for an assembly to run.

This action can be applied to assemblies.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.RequestOptional Field

RequestOptional = 9;

Summary

Specifies that the current security attribute describes optional permissions that an assembly can be granted.

This action can be applied to assemblies.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.RequestRefuse Field

RequestRefuse = 10;

Summary

Specifies that the current security attribute describes resources or operations that an assembly cannot access.

This action can be applied to assemblies.

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace

SecurityAction.value__ Field

value__;

See Also

System.Security.Permissions.SecurityAction Enum, System.Security.Permissions Namespace