Mono Class Library: System.Security.PermissionSet Overview | Members

System.Security.PermissionSet.Deny Method

Denies access to the resources secured by the objects contained in the current instance through the code that calls this method.

public void Deny ()

Exceptions

TypeReason
System.Security.SecurityExceptionA previous call to Deny has already restricted the permissions for the current stack frame.

Remarks

This is the only way to deny multiple permissions at the same time within a frame because only a single deny can be active on a frame at one time; subsequent denies will result in an exception.

Operation

This method is required to prevent callers from accessing all resources protected by the objects in the current instance even if the callers had been granted permission to access them.

A call to PermissionSet.Deny is effective until the calling code returns.

Usage
Use this method to force all security checks for the objects contained in the current instance to fail.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0