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 System.Security.ISecurityEncodable System.Runtime.InteropServices.ComVisible(true)

Permissions in the common language runtime are objects that describe sets of operations that can be secured for specified resources. A permission object describes operations or access that is subject to security control; it does not represent access or a right to perform operations. Permissions are used by both application code and the .NET Framework security system in the following ways.

Code requests the permissions it needs in order to run.

The security system policy grants permissions to code in order for it to run.

Code demands that calling code has a permission.

Code overrides the security stack using assert/deny/permit-only.

If you write a new permission, you must implement this interface in your class.

A permission can be accessed by multiple threads. When implementing this interface, you must guarantee that the , , , and method implementations are thread safe.

Defines methods implemented by permission types.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

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

  Creates and returns an identical copy of the current permission.

  A copy of the current permission.

  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.

  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.

  Although the majority of the classes that implement this interface method satisfy the security criteria by performing a full stack walk, a stack walk is not necessarily performed. An example of an implementation that does not perform a stack walk is .

  When a stack walk is performed, 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.

  Throws a at run time if the security requirement is not met.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not and is not of the same type as the current instance.

  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.

  The following statements are required to be true for all implementations of the method. and represent object references that are not null.

  .Intersect() returns a value equal to .

  .Intersect() returns the same value as .Intersect().

  .Intersect(null) returns null.

  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 the same type as the current instance.

  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 implementations of the method. , , and represent objects that are not null.

  .IsSubsetOf() returns true.

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

  If .IsSubsetOf() and .IsSubsetOf() both return true, .IsSubsetOf() returns true.

  If represents an empty object with a permission state of and represents an object that is null, .IsSubsetOf() returns true. If is also an empty permission, the compound set operation .Union(Z).IsSubsetOf(Y) also returns true because the union of two empty permissions is an empty permission.

  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.Security.IPermission `` is not and is not of the same type as the current instance.

  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.

  The following statements are required to be true for all implementations of the method. and represent objects that are not null.

  .Union() returns an object that has the same value as .

  .Union() returns an object that has the same value as the object returned by .Union().

  .Union(null) returns an object that has the same value as .

  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