Forces a System.Security.SecurityException if all callers do not have the permission specified by the current instance.
Type Reason System.Security.SecurityException A caller does not have the permission specified by the current instance.
The permission check for IPermission.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.
Operation
Notifies the system that a security check is required for all callers of the method that invokes IPermission.Demand. All callers are required to have the permissions described by the current instance. If one of the callers asserts the permissions and that caller has the permissions, the system is required to allow all callers that have not been checked to bypass the security check. If the security check fails, a System.Security.SecurityException is thrown by the system.Usage
Use this method to ensure that callers that call the method containing a IPermission.Demand call have the permissions described by the current instance.
Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0