BCL 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 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object System.Security.IPermission System.Security.IStackWalk System.Runtime.InteropServices.ComVisible(true)

Code access permissions use a stack walk to ensure that all callers of the code have been granted a permission. If a permission object is null, it is handled the same as a permission object with the state .

The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.

Inheritors of the class must be granted full trust to function correctly as permissions extending the security infrastructure. To determine that the inheritors are fully trusted, issues an for = true and = true.

For more information on inheritance demands, see Inheritance Demands.

Defines the underlying structure of all code access permissions.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  This constructor is called to initialize state in the type whenever an instance of the derived class is created. Although you can explicitly call this constructor in the constructor declaration of the derived class constructor, this is not usually necessary; most compilers will automatically generate the call for you.

  Initializes a new instance of the class.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void The calling code does not have . Requires permission to call . See .

  The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack. Calling prevents a stack walk originating lower in the call stack from proceeding up the call stack beyond the code that calls this method. Therefore, even if callers higher on the call stack do not have the requisite permissions to access a resource, they can still access it through the code that calls this method on the necessary permission. An assertion is effective only if the code that calls passes the security check for the permission that it is asserting.

  The call to is effective until the calling code returns to its caller. Only one can be active on a frame. An attempt to call when an active exists on the frame results in a . Call or to remove an active .

  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 issues if used incorrectly or inappropriately. Therefore, it should be used with great caution.

  Declares that the calling code can access the resource protected by a permission demand through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. Using can create security issues.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

  A copy of a permission object represents the same access to resources as the original permission object.

  When implemented by a derived class, creates and returns an identical copy of the current permission object.

  A copy of the current permission object.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  A caller does not have the permission specified by the current instance.

  -or-

  A caller has called for the resource protected by the current instance.

  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. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack. succeeds only if no is raised.

  Forces a at run time if all callers higher in the call stack have not been granted the permission specified by the current instance.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  The method should be used only to protect resources from accidental access by fully trusted code. It should not be used to protect resources from intentional misuse by untrusted code. For example, if method A issues a for a permission and then calls method B, method B can overtly override the by issuing an . The called method is always higher in the stack. Therefore, if method B tries to access a protected resource, the security system begins checking for permissions with it because method B is the immediate caller, and then walks down the stack to confirm that there is no or lower in the stack. Method B, which is trying to access the resource, can stop the stack walk immediately by using the method. In that case, the placed on the stack by method A (the calling method) is never discovered.

  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 issues 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 .

  The call to is effective until the calling code returns to its caller. Only one can be active on a frame. An attempt to call when an active exists on the frame results in a . Call or to remove an active . is ignored for a permission not granted because a demand for that permission will not succeed.

  Prevents callers higher in the call stack from using the code that calls this method to access the resource specified by the current instance.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean ``

  For more information, see .

  Determines whether the specified object is equal to the current .

  true if the specified object is equal to the current ; otherwise, false.

  The object to compare with the current .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  does not contain the XML encoding for a instance of the same type as the current instance.

  -or-

  The version number of is not valid.

  Custom code that extends security objects needs to implement the and methods to make the objects security-encodable.

  When overridden in a derived class, reconstructs a security object with a specified state from an XML encoding.

  The XML encoding to use to reconstruct the security object. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32

  The hash code for two instances of the same permission might be different, hence a hash code should not be used to compare two objects.

  Gets a hash code for the object that is suitable for use in hashing algorithms and data structures such as a hash table.

  A hash code for the current object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not and is not a object.

  The intersection of two permissions is a permission that describes the set of operations they both describe in common. Only a demand that passes both original permissions will pass the intersection.

  When implemented by a derived class, creates and returns a permission that is the intersection of the current permission and the specified permission.

  A new permission that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty.

  A permission to intersect with the current permission. It must be of the same type as the current permission. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` is not and is not of type .

  The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to C:\example.txt is a subset of a permission that represents access to C:\. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

  The following statements are required to be true for all overrides of the method. X, Y, and Z represent custom code access permission objects that are not null references, U represents an unrestricted code access permission, and N represents an empty permission with a of .

  X.IsSubsetOf(X) returns true.

  X.IsSubsetOf(Y) returns the same value as Y.IsSubsetOf(X) if and only if X and Y represent the same set of permissions.

  If X.IsSubsetOf(Y) and Y.IsSubsetOf(Z) both return true, X.IsSubsetOf(Z) returns true.

  X.IsSubsetOf(U) returns true.

  X.IsSubsetOf(N) returns false.

  N.IsSubsetOf(X) returns true.

  If X and Y represent custom code access permission objects that are null references, X.IsSubsetOf(Y) returns true. If Z is also null, the compound set operation X.Union(Y).IsSubsetOf(Z) also returns true because the union of two null permissions is a null permission.

  When implemented by a derived class, determines whether the current permission is a subset of the specified permission.

  true if the current permission is a subset of the specified permission; otherwise, false.

  A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  The method should be used only to protect resources from accidental access by fully trusted code. It should not be used to protect resources from intentional misuse by untrusted code. For example, if method A issues a for a permission and then calls method B, method B can overtly override the by issuing an . The called method is always higher in the stack. Therefore, if method B tries to access a protected resource, the security system begins checking for permissions with it because method B is the immediate caller, and then walks down the stack to confirm that there is no or lower in the stack. Method B, which is trying to access the resource, can stop the stack walk immediately by using the method. In that case, the placed on the stack by method A (the calling method) is never discovered.

  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. The call to is effective until the calling code returns to its caller. Only one can be active on a frame. An attempt to call when an active exists on the frame results in a . Call or to remove an active .

  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.

  Prevents callers higher in the call stack from using the code that calls this method to access all resources except for the resource specified by the current instance.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  If there are no overrides (, , or ) for the current frame, an is thrown.

  Causes all previous overrides for the current frame to be removed and no longer in effect.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  If there is no for the current frame, an is thrown.

  Causes any previous for the current frame to be removed and no longer in effect.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  If there is no for the current frame, an is thrown.

  Causes any previous for the current frame to be removed and no longer in effect.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  If there is no for the current frame, an is thrown.

  Causes any previous for the current frame to be removed and no longer in effect.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  This method is useful in debugging when you need to display the permission as a string.

  Creates and returns a string representation of the current permission object.

  A string representation of the current permission object.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement

  Custom code that extends security objects needs to implement the and methods to make the objects security-encodable.

  When overridden in a derived class, creates an XML encoding of the security object and its current state.

  An XML encoding of the security object, including any state information.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not of type . is not .

  The result of a call to is a permission that represents all the operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.

  When overridden in a derived class, creates a permission that is the union of the current permission and the specified permission.

  A new permission that represents the union of the current permission and the specified permission.

  A permission to combine with the current permission. It must be of the same type as the current permission. 0
0