Determines at run-time whether all callers in the call chain have been granted the permission specified by the current permission object.
[Visual Basic] Overridable Public Sub Demand() [C#] public virtual void Demand(); [C++] public: virtual void Demand(); [JScript] public function Demand();
Exception Type | Condition |
---|---|
SecurityException | A caller in the call chain does not have the permission demanded.
A caller in the call chain has called Deny or PermitOnly on the demanded permission. |
If no SecurityException is raised, the demand succeeds.
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.
CodeAccessPermission Class | CodeAccessPermission Members | System.Security Namespace