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

System.Security.PermissionSet.Demand Method

Forces a System.Security.SecurityException if all callers do not have the permissions specified by the objects contained in the current instance.

public void Demand ()

Exceptions

TypeReason
System.Security.SecurityExceptionA caller does not have the permission specified by the current instance.

Remarks

Operation

The permission check for PermissionSet.Demand begins with the immediate caller of the code that calls this method and continues until all callers have been checked or a caller has been found that is not granted the demanded permission, in which case a System.Security.SecurityException exception is thrown.

If the current instance is empty, a call to PermissionSet.Demand succeeds.

Usage
Use this method to ensure in a single operation that all callers have all permissions contained in a permission set.

Requirements

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