NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

CodeAccessPermission.Demand

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();

Exceptions

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.

Remarks

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.

See Also

CodeAccessPermission Class | CodeAccessPermission Members | System.Security Namespace