Name

SecurityAction

Synopsis

public enum SecurityAction {
   Demand = 2,Assert = 3,Deny = 4,PermitOnly = 5,LinkDemand = 6,InheritanceDemand = 7,
        RequestMinimum = 8,RequestOptional = 9,RequestRefuse = 10
}

The SecurityAction enumeration contains values that represent the different declarative security statements. Every permission attribute class derived from the CodeAccessSecurityAttribute class defines a constructor that takes a value of the SecurityAction enumeration as an argument. The value of the SecurityAction argument identifies the action that the declarative security statement performs, and determines the program elements that are valid targets for the security attribute. The nine values of the SecurityAction enumeration fall into three categories: security demands, permission requests, and stack overrides. Declarative security demands and stack overrides can be applied to classes and functional members (i.e., methods, properties, and events), whereas permission requests are valid only at the assembly level.

The security demands include the values Demand, InheritanceDemand, and LinkDemand. Demand initiates a security demand, which will result in a stack walk when used with an attribute whose permission counterpart implements the System.Security.IStackWalk interfaces. This includes all code-access and identity permissions, but not PrincipalPermission, which only implements the System.Security.IPermission interface. The InheritanceDemand and LinkDemand statements have no imperative ...

Get Programming .NET Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.