Export (0) Print
Expand All

IStackWalk.Deny Method

Causes every Demand for the current object that passes through the calling code to fail.

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)

void Deny ()
void Deny ()
function Deny ()
Not applicable.

This method prevents callers higher in the call stack 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 stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.

Deny can limit the liability of the programmer or help prevent accidental security vulnerabilities because it helps prevent the method that calls Deny from being used to access the resource protected by the denied permission. If a method calls Deny on a permission, and if a Demand for that permission is invoked by a caller lower in the call stack, that security check will fail when it reaches the Deny.

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

Notes to Inheritors: You cannot override this method.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft