System.Security.PermissionSet: Method Members

The methods of System.Security.PermissionSet are listed below. For a list of all members, see the PermissionSet Members list.

See Also: Inherited members from System.Object

Public Methods

AddPermission(IPermission) : IPermission

Adds a specified permission to the System.Security.PermissionSet.

Assert()

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 PermissionSet.Assert can create security vulnerabilities.

ContainsNonCodeAccessPermissions() : bool

Gets a value indicating whether the System.Security.PermissionSet contains permissions that are not derived from System.Security.CodeAccessPermission.

static
ConvertPermissionSet(string, byte[], string) : byte[]

Converts an encoded System.Security.PermissionSet from one XML encoding format to another XML encoding format.

Copy() : PermissionSet

Creates a copy of the System.Security.PermissionSet.

CopyTo(Array, int)

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

Demand()

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

Deny()

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

override
Equals(object) : bool

Determines whether the specified System.Security.PermissionSet or System.Security.NamedPermissionSet object is equal to the current System.Security.PermissionSet.

FromXml(SecurityElement)

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

GetEnumerator() : IEnumerator

Returns an enumerator for the permissions of the set.

override
GetHashCode() : int

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

GetPermission(Type) : IPermission

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

Intersect(PermissionSet) : PermissionSet

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

IsEmpty() : bool

Gets a value indicating whether the System.Security.PermissionSet is empty.

IsSubsetOf(PermissionSet) : bool

Determines whether the current System.Security.PermissionSet is a subset of the specified System.Security.PermissionSet.

IsUnrestricted() : bool

Determines whether the System.Security.PermissionSet is Unrestricted.

PermitOnly()

Causes any PermissionSet.Demand that passes through the calling code for any System.Security.PermissionSet that is not a subset of the current System.Security.PermissionSet to fail.

RemovePermission(Type) : IPermission

Removes a permission of a certain type from the set.

static
RevertAssert()

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

SetPermission(IPermission) : IPermission

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

override
ToString() : string

Returns a string representation of the System.Security.PermissionSet.

ToXml() : SecurityElement

Creates an XML encoding of the security object and its current state.

Union(PermissionSet) : PermissionSet

Creates a System.Security.PermissionSet that is the union of the current System.Security.PermissionSet and the specified System.Security.PermissionSet.