mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Runtime.InteropServices.ComVisible(true)

Partially trusted code always presents a security risk. It can sometimes be manipulated to perform actions on behalf of malicious code that does not have permission to access a resource. In this way, malicious code can achieve higher security access than it should be allowed.

The common language runtime helps protect managed code from these attacks by running a stack walk on all calls. The stack walk requires that all code in the call stack has permission to access a protected resource. Because the code attempting the attack will always be somewhere in the call stack, it will be unable to exceed its own security permissions.

Manages the stack walk that determines whether all callers in the call stack have the required permissions to access a protected resource.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  Calling stops the permission check on callers higher in the call stack. Therefore, even if these callers do not have the requisite permissions, they can still access resources. An assertion is effective only if the code that calls passes the security check for the permission that it is asserting.

  A call to is effective until the calling code returns to its caller or until a subsequent call to renders the previous assertion ineffective. Also, or removes a pending .

  is ignored for a permission not granted because a demand for that permission will not succeed. However, if code lower on the call stack calls for that permission, a is thrown when the stack walk reaches the code that tried to call . This happens because the code that called has not been granted the permission, even though it tried to it.

  Because calling removes the requirement that all code in the call chain must be granted permission to access the specified resource, it can open up security vulnerabilities if used incorrectly or inappropriately. Therefore, it should be used with great caution.

  Asserts that the calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  This method is typically used by secure libraries to ensure that callers have permission to access a resource. For example, a file class in a secure class library calls for the necessary before performing a file operation requested by the caller.

  The permissions of the code that calls this method are not examined; the check begins from the immediate caller of that code and proceeds up the stack. succeeds only if no is raised.

  Determines at run time whether all callers in the call stack have been granted the permission specified by the current permission object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  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.

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

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

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

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  is similar to , in that both cause stack walks to fail when they would otherwise succeed. The difference is that specifies permissions that will cause the stack walk to fail, but specifies the only permissions that do not cause the stack walk to fail. Call this method to ensure that your code can be used to access only the specified resources.

  is ignored for a permission not granted because a demand for that permission will not succeed. However, if code lower on the call stack later calls for that permission, a is thrown when the stack walk reaches the code that tried to call . This is because the code that called has not been granted the permission, even though it called for that permission. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.

  Causes every for all objects except the current one that passes through the calling code to fail, even if code higher in the call stack has been granted permission to access other resources.