Demands at run-time that the immediate caller of the code that calls this method has the permission.
[Visual Basic] Sub DemandImmediate() [C#] void DemandImmediate(); [C++] void DemandImmediate() = 0; [JScript] function DemandImmediate();
Exception Type | Condition |
---|---|
SecurityException | The immediate caller does not have the permission demanded. |
Since this method only checks the permissions of the immediate caller, it is only appropriate for enforcement of security when all callers of the code can be trusted to not expose security vulnerabilities. Specifically, the code must take other measures to protect against luring attacks, where malicious code without the permission "tricks" other code that does have the permission into making a call.
IPermission Interface | IPermission Members | System.Security Namespace