Mono Class Library: System.Security.CodeAccessPermission Overview | Members

System.Security.CodeAccessPermission.Deny Method

Denies access to the resources specified by the current instance through the code that calls this method.

public void Deny ()

Remarks

This method prevents callers from accessing the protected resource through the code that calls this method, even if those callers have been granted permission to access it.

The call to CodeAccessPermission.Deny is effective until the calling code returns.

Note:

CodeAccessPermission.Deny is ignored for a permission not granted because a demand for that permission will not succeed.

CodeAccessPermission.Deny can limit the liability of the programmer or prevent accidental security vulnerabilities because it prevents the method that calls CodeAccessPermission.Deny from being used to access the resource protected by the denied permission.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0