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.Collections.ICollection System.Runtime.Serialization.IDeserializationCallback System.Security.ISecurityEncodable System.Security.IStackWalk System.Runtime.InteropServices.ComVisible(true)

You can use to perform operations on several different permissions as a group.

Represents a collection that can contain many different types of permissions.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is not a valid value.

  The Unrestricted state allows all permissions that implement the interface, while None allows no permissions.

  Use on an empty to define the set in greater detail.

  Initializes a new instance of the class with the specified .

  One of the enumeration values that specifies the permission set's access to resources.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is not and is not an instance of .

  The new contains copies of the permissions contained in the specified .

  This is equivalent to when the parameter is not null.

  Initializes a new instance of the class with initial values taken from the parameter.

  The set from which to take the value of the new , or null to create an empty .
  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission `` is not a object.

  If a permission of the same type as the added permission already exists in the , the new permission is the union of the existing permission object and the specified permission object. For example, if a permission that implements is added to an , the resulting union is the original Unrestricted .

  Adds a specified permission to the .

  The union of the permission added and any permission of the same type that already exists in the .

  The permission to add. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  The asserting code does not have sufficient permission to call this method.

  -or-

  This method was called with permissions already asserted for the current stack frame.

  Requires permission to perform the assertion security operation. See .

  This is the only way to assert multiple permissions at the same time within a frame because only one can be active on a frame. is only effective for granted permissions. Call the or method to cancel an active .

  Because calling the method 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.

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

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Gets a value indicating whether the contains permissions that are not derived from .

  true if the contains permissions that are not derived from ; otherwise, false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` `` ``

  Do not use this method.

  Converts an encoded from one XML encoding format to another XML encoding format.

  An encrypted permission set with the specified output format.

  A string representing one of the following encoding formats: ASCII, Unicode, or Binary. Possible values are "XMLASCII" or "XML", "XMLUNICODE", and "BINARY". An XML-encoded permission set. A string representing one of the following encoding formats: ASCII, Unicode, or Binary. Possible values are "XMLASCII" or "XML", "XMLUNICODE", and "BINARY".
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.PermissionSet

  A copy of a represents the same access to resources as the original object. Changes made to the copy do not affect the original permission set.

  Creates a copy of the .

  A copy of the .

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  This method is implemented to support the interface.

  As described above.

  The default implementation uses the (, ) method to add the value to the array.

  Override this method to customize the manner in which elements are added to .

  has more than one dimension. is outside the range of allowable values for . is .

  Copies the permission objects of the set to the indicated location in an .

  The target array to which to copy. The starting position in the array to begin copying (zero based). 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  In the None or Unrestricted state this returns zero, because no actual permission object instances are used.

  Gets the number of permission objects contained in the permission set.

  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.

  Use on a to ensure that all callers have all permissions in the set with one operation.

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

  If the contains permissions that do not inherit from , the Demand methods of those permissions are called as well.

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

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  A previous call to has already restricted the permissions for the current stack frame.

  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 fails when it reaches the .

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

  Causes any that passes through the calling code for a permission that has an intersection with a permission of a type contained in the current to fail.

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

  Equality is determined by the permissions contained in the permission set specified by . can be either a object or a object. If is a , the name and description are ignored.

  For more information, see .

  Determines whether the specified or object is equal to the current .

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

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

  For the XML encoding for this class, see the class page.

  When this call completes, the objects in the current instance are required to be identical to the objects in the encoded in .

  Override this method to reconstruct subclasses of .

  Applications do not typically call this method; it is called by the system.

  is .

  does not contain an XML encoding for a instance.

  -or-

  An error occurred while reconstructing .

  Reconstructs a security object with a specified state from an XML encoding.

  The XML encoding to use to reconstruct the security object. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  Use the enumerator as an index to access individual permission objects in the set.

  Returns an enumerator for the permissions of the set.

  An enumerator object for the permissions of the set.

  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 set might be different, so 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 ``

  The method returns null for an Unrestricted . Although an Unrestricted effectively contains all permissions, it does not have any actual instances to return.

  Gets a permission object of the specified type, if it exists in the set.

  A copy of the permission object of the type specified by the parameter contained in the , or null if none exists.

  The type of the desired permission object.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.PermissionSet ``

  The intersection of two permission sets is a permission set that describes the set of operations they both describe in common. Specifically, it represents the minimum permissions such that any demand that passes both permission sets also passes their intersection.

  For each type of permission that is present in both sets, the two instances of those permissions are intersected using the permission's Intersect method; the resulting permission is included in the resulting . Permission types that exist in only one of the two sets are excluded from the resulting set.

  Creates and returns a permission set that is the intersection of the current and the specified .

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

  A permission set to intersect with the current .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  A can be empty and yet contain instances of permissions if those permissions are in the fully-restricted state. Permissions are in a fully restricted state if their IsSubsetOf methods return true when null is passed as a parameter.

  Gets a value indicating whether the is empty.

  true if the is empty; otherwise, false.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  A cannot be read-only, so this property is always false.

  Gets a value indicating whether the collection is read-only.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  A is a subset of the target if all demands that succeed for the also succeed for the target. That is, the target contains at least the permissions contained in the subset.

  Determines whether the current is a subset of the specified .

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

  The permission set to test for the subset relationship. This must be either a or a . 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  does not automatically handle thread safety, so this property is always false.

  This method is required to support .

  Gets a value indicating whether the collection is guaranteed to be thread safe.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  An Unrestricted effectively contains all permissions that implement the interface.

  Determines whether the is Unrestricted.

  true if the is Unrestricted; otherwise, false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  A previous call to has already set the permissions for the current stack frame.

  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 cannot 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 any that passes through the calling code for any that is not a subset of the current to fail.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission ``

  You cannot remove permissions from an unrestricted permission set. The permission set remains unrestricted after you attempt to remove the permission, and an exception is not thrown.

  The following C# code attempts to remove the from the FullTrust permission set, but the permission is not removed.

  `PolicyLevel myPol = PolicyLevel.CreateAppDomainLevel(); PermissionSet myPermSet = myPol.GetNamedPermissionSet("FullTrust"); myPermSet.RemovePermission(typeof(FileIOPermission));`

  Removes a permission of a certain type from the set.

  The permission removed from the set.

  The type of permission to delete.
- Method
  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 be in effect.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission ``

  This method removes any existing permission object of the same type from the and replaces it with the parameter. If a permission that implements is set on a that is , the resulting is no longer Unrestricted.

  Sets a permission to the , replacing any existing permission of the same type.

  The set permission.

  The permission to set.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object To be added.

  This method is required to support .

  Gets the root object of the current collection.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  Runs when the entire object graph has been deserialized.

  The object that initiated the callback. The functionality for this parameter is not currently implemented.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The following example displays the XML that encodes the state of a .

  `using System; using System.Security; using System.Security.Permissions; public class PermissionSetToStringExample { public static void Main() { PermissionSet ps = new PermissionSet(PermissionState.Unrestricted); Console.WriteLine(ps.ToString()); } }`

  The output is

  <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true"/>

  The string representation is useful in debugging to see the state of a .

  Returns a string representation of the .

  A representation of the .

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement

  As described above.

  Override this method to return an object containing the XML encoding for types derived from .

  This method is called by the system.

  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.PermissionSet ``

  The result of a call to is a that represents all the operations represented by the current as well as all the operations represented by the specified . If either set is Unrestricted, the union is Unrestricted as well.

  Creates a that is the union of the current and the specified .

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

  The permission set to form the union with the current . 0
0