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

System.Security.PermissionSet.Assert Method

Asserts that calling code can access the resources identified by the permissions contained in the current instance through the code that calls this method, even if callers have not been granted permission to access the resource.

public void Assert ()

Permissions

TypeReason
System.Security.Permissions.SecurityPermissionRequires permission to perform the assertion security operation. See System.Security.Permissions.SecurityPermissionFlag.Assertion.

Exceptions

TypeReason
System.Security.SecurityException

The asserting code does not have sufficient permission to call this method.

-or-

This method was called with permissions already asserted for the current stack frame.

Remarks

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

Operation
As described above.

Usage
Use this method to insure that all callers can access a set of secured resources.

Requirements

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