Demands at run-time that all callers in the call chain have the permission specified by the current permission object. The permissions of the code that calls this method itself are not checked; rather, the check begins from the immediate caller of that code and proceeds up the stack.
[Visual Basic] Sub Demand() [C#] void Demand(); [C++] void Demand() = 0; [JScript] function Demand();
Exception Type | Condition |
---|---|
SecurityException | if any caller does not have the permission demanded. |
This method is typically used by secure libraries to ensure that callers have a particular permission. For example, a file class in a secure class library will demand the necessary FileIOPermission before performing a file operation requested by the caller.
IPermission Interface | IPermission Members | System.Security Namespace