Este artículo se tradujo automáticamente. Para ver el artículo en inglés, active la casilla Inglés. Además, puede mostrar el texto en inglés en una ventana emergente si mueve el puntero del mouse sobre el texto.
Traducción
Inglés

Propiedad SecurityException.Action

 

Publicado: octubre de 2016

Obtiene o establece la acción de seguridad que produjo la excepción.

Espacio de nombres:   System.Security
Ensamblado:  mscorlib (en mscorlib.dll)

[ComVisibleAttribute(false)]
public SecurityAction Action { get; set; }

Valor de propiedad

Type: System.Security.Permissions.SecurityAction

Uno de los valores de SecurityAction.

The P:System.Security.SecurityException.Action property contains the security action that caused the security check failure. Many of the security actions can cause a security exception to be thrown. For example, a demand on a permission set checks that all callers on the call stack have the necessary permissions in the permission set. If any caller on the call stack lacks a required permission, the security check fails. Alternatively, a method in the call chain can modify the outcome of the stack walk by placing a stack walk modifier, such as F:System.Security.Permissions.SecurityAction.Deny or F:System.Security.Permissions.SecurityAction.PermitOnly, on the stack to limit the allowed permissions. For example, a method on the call stack might deny all of its callers a set of permissions named PSET1, such that any demand for a permission that is part of PSET1 fails for those callers. The P:System.Security.SecurityException.Action property contains the security action that caused the exception to be thrown.

SecurityAction is an enumeration in the SecurityAction namespace that provides the security action value for the Action property. Typically this property contains one of the values shown in the following table.

Security action

Description

Demand

A full stack walk failed due to a demand made against the assembly identified by the P:System.Security.SecurityException.FailedAssemblyInfo property.

LinkDemand

A link demand against the assembly identified by the P:System.Security.SecurityException.FailedAssemblyInfo property failed.

InheritanceDemand

An assembly identified by the P:System.Security.SecurityException.FailedAssemblyInfo property failed to meet an inheritance demand.

PermitOnly

A demanded permission did not match any permission in the F:System.Security.Permissions.SecurityAction.PermitOnly permission set. The method that placed the F:System.Security.Permissions.SecurityAction.PermitOnly on the call stack is identified by the P:System.Security.SecurityException.Method property.

Deny

A demanded permission matched a permission in the deny permission set on the call stack. The method that placed the F:System.Security.Permissions.SecurityAction.Deny on the call stack is identified by the P:System.Security.SecurityException.Method property.

.NET Framework
Disponible desde 2.0
Volver al principio
Mostrar: