Export (0) Print
Expand All

PermissionSet Class

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

Namespace:  System.Security
Assembly:  mscorlib (in mscorlib.dll)

[<SerializableAttribute>]
[<ComVisibleAttribute(true)>]
[<StrongNameIdentityPermissionAttribute(SecurityAction.InheritanceDemand, Name = "mscorlib", 
    PublicKey = "0x00000000000000000400000000000000")>]
type PermissionSet =  
    class 
        interface ISecurityEncodable 
        interface ICollection 
        interface IEnumerable 
        interface IStackWalk 
        interface IDeserializationCallback 
    end

The PermissionSet type exposes the following members.

  NameDescription
Public methodPermissionSet(PermissionSet)Initializes a new instance of the PermissionSet class with initial values taken from the permSet parameter.
Public methodPermissionSet(PermissionState)Initializes a new instance of the PermissionSet class with the specified PermissionState.
Top

  NameDescription
Public propertyCountGets the number of permission objects contained in the permission set.
Public propertyIsReadOnlyGets a value indicating whether the collection is read-only.
Public propertyIsSynchronizedGets a value indicating whether the collection is guaranteed to be thread safe.
Public propertySyncRootGets the root object of the current collection.
Top

  NameDescription
Public methodAddPermissionAdds a specified permission to the PermissionSet.
Protected methodAddPermissionImplAdds a specified permission to the PermissionSet.
Public methodAssertDeclares 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 Assert can create security vulnerabilities.
Public methodContainsNonCodeAccessPermissionsGets a value indicating whether the PermissionSet contains permissions that are not derived from CodeAccessPermission.
Public methodStatic memberConvertPermissionSetInfrastructure. Obsolete. Converts an encoded PermissionSet from one XML encoding format to another XML encoding format.
Public methodCopyCreates a copy of the PermissionSet.
Public methodCopyToCopies the permission objects of the set to the indicated location in an Array.
Public methodDemandForces a SecurityException at run time if all callers higher in the call stack have not been granted the permissions specified by the current instance.
Public methodDeny Obsolete. Causes any Demand that passes through the calling code for a permission that has an intersection with a permission of a type contained in the current PermissionSet to fail.
Public methodEqualsDetermines whether the specified PermissionSet or NamedPermissionSet object is equal to the current PermissionSet. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFromXmlReconstructs a security object with a specified state from an XML encoding.
Public methodGetEnumeratorReturns an enumerator for the permissions of the set.
Protected methodGetEnumeratorImplReturns an enumerator for the permissions of the set.
Public methodGetHashCodeGets a hash code for the PermissionSet object that is suitable for use in hashing algorithms and data structures such as a hash table. (Overrides Object.GetHashCode().)
Public methodGetPermissionGets a permission object of the specified type, if it exists in the set.
Protected methodGetPermissionImplGets a permission object of the specified type, if it exists in the set.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIntersectCreates and returns a permission set that is the intersection of the current PermissionSet and the specified PermissionSet.
Public methodIsEmptyGets a value indicating whether the PermissionSet is empty.
Public methodIsSubsetOfDetermines whether the current PermissionSet is a subset of the specified PermissionSet.
Public methodIsUnrestrictedDetermines whether the PermissionSet is Unrestricted.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPermitOnlyCauses any Demand that passes through the calling code for any PermissionSet that is not a subset of the current PermissionSet to fail.
Public methodRemovePermissionRemoves a permission of a certain type from the set.
Protected methodRemovePermissionImplRemoves a permission of a certain type from the set.
Public methodStatic memberRevertAssertCauses any previous Assert for the current frame to be removed and no longer be in effect.
Public methodSetPermissionSets a permission to the PermissionSet, replacing any existing permission of the same type.
Protected methodSetPermissionImplSets a permission to the PermissionSet, replacing any existing permission of the same type.
Public methodToStringReturns a string representation of the PermissionSet. (Overrides Object.ToString().)
Public methodToXmlCreates an XML encoding of the security object and its current state.
Public methodUnionCreates a PermissionSet that is the union of the current PermissionSet and the specified PermissionSet.
Top

  NameDescription
Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast(TResult)Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType(TResult)Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIDeserializationCallback.OnDeserializationInfrastructure. Runs when the entire object graph has been deserialized.
Top

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

The following code example demonstrates the use of the PermissionSet class and members.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft