Export (0) Print
Expand All

ReadOnlyPermissionSet Class

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

System.Object
  System.Security.PermissionSet
    System.Security.ReadOnlyPermissionSet

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

[<Sealed>]
[<SerializableAttribute>]
type ReadOnlyPermissionSet =  
    class 
        inherit PermissionSet 
    end

The ReadOnlyPermissionSet type exposes the following members.

  NameDescription
Public methodReadOnlyPermissionSetInitializes a new instance of the ReadOnlyPermissionSet class.
Top

  NameDescription
Public propertyCountGets the number of permission objects contained in the permission set. (Inherited from PermissionSet.)
Public propertyIsReadOnlyGets a value that indicates whether the collection is read-only. (Overrides PermissionSet.IsReadOnly.)
Public propertyIsSynchronizedGets a value indicating whether the collection is guaranteed to be thread safe. (Inherited from PermissionSet.)
Public propertySyncRootGets the root object of the current collection. (Inherited from PermissionSet.)
Top

  NameDescription
Public methodAddPermissionAdds a specified permission to the PermissionSet. (Inherited from 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. (Inherited from PermissionSet.)
Public methodContainsNonCodeAccessPermissionsGets a value indicating whether the PermissionSet contains permissions that are not derived from CodeAccessPermission. (Inherited from PermissionSet.)
Public methodCopyCreates a copy of the ReadOnlyPermissionSet. (Overrides PermissionSet.Copy().)
Public methodCopyToCopies the permission objects of the set to the indicated location in an Array. (Inherited from PermissionSet.)
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. (Inherited from PermissionSet.)
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. (Inherited from PermissionSet.)
Public methodEqualsDetermines whether the specified PermissionSet or NamedPermissionSet object is equal to the current PermissionSet. (Inherited from PermissionSet.)
Public methodFromXmlReconstructs a security object with a specified state from an XML encoding. (Overrides PermissionSet.FromXml(SecurityElement).)
Public methodGetEnumeratorReturns an enumerator for the permissions of the set. (Inherited from PermissionSet.)
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. (Inherited from PermissionSet.)
Public methodGetPermissionGets a permission object of the specified type, if it exists in the set. (Inherited from PermissionSet.)
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. (Inherited from PermissionSet.)
Public methodIsEmptyGets a value indicating whether the PermissionSet is empty. (Inherited from PermissionSet.)
Public methodIsSubsetOfDetermines whether the current PermissionSet is a subset of the specified PermissionSet. (Inherited from PermissionSet.)
Public methodIsUnrestrictedDetermines whether the PermissionSet is Unrestricted. (Inherited from PermissionSet.)
Public methodPermitOnlyCauses any Demand that passes through the calling code for any PermissionSet that is not a subset of the current PermissionSet to fail. (Inherited from PermissionSet.)
Public methodRemovePermissionRemoves a permission of a certain type from the set. (Inherited from PermissionSet.)
Public methodSetPermissionSets a permission to the PermissionSet, replacing any existing permission of the same type. (Inherited from PermissionSet.)
Public methodToStringReturns a string representation of the PermissionSet. (Inherited from PermissionSet.)
Public methodToXmlCreates an XML encoding of the security object and its current state. (Overrides PermissionSet.ToXml().)
Public methodUnionCreates a PermissionSet that is the union of the current PermissionSet and the specified PermissionSet. (Inherited from PermissionSet.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIDeserializationCallback.OnDeserializationInfrastructure. Runs when the entire object graph has been deserialized. (Inherited from PermissionSet.)
Top

Read-only permission sets are created from explicit XML and cannot be modified after creation. This restriction ensures that the permission set will be restored to the same XML encoding that it was originally created from. Attempting to add or remove a permission from the ReadOnlyPermissionSet results in an InvalidOperationException.

Note that any permission you obtain from the ReadOnlyPermissionSet is only a copy of the permission. If the copy is mutable and is changed, the permission that is in the ReadOnlyPermissionSet is not changed.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

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