ReadOnlyPermissionSet Class
Represents a read-only collection that can contain many different types of permissions.
Assembly: mscorlib (in mscorlib.dll)
The ReadOnlyPermissionSet type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ReadOnlyPermissionSet | Initializes a new instance of the ReadOnlyPermissionSet class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of permission objects contained in the permission set. (Inherited from PermissionSet.) |
![]() | IsReadOnly | Gets a value that indicates whether the collection is read-only. (Overrides PermissionSet::IsReadOnly.) |
![]() | IsSynchronized | Gets a value indicating whether the collection is guaranteed to be thread safe. (Inherited from PermissionSet.) |
![]() | SyncRoot | Gets the root object of the current collection. (Inherited from PermissionSet.) |
| Name | Description | |
|---|---|---|
![]() | AddPermission | Adds a specified permission to the PermissionSet. (Inherited from PermissionSet.) |
![]() | AddPermissionImpl | Adds a specified permission to the PermissionSet. (Inherited from 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 Assert can create security vulnerabilities. (Inherited from PermissionSet.) |
![]() | ContainsNonCodeAccessPermissions | Gets a value indicating whether the PermissionSet contains permissions that are not derived from CodeAccessPermission. (Inherited from PermissionSet.) |
![]() | Copy | Creates a copy of the ReadOnlyPermissionSet. (Overrides PermissionSet::Copy().) |
![]() | CopyTo | Copies the permission objects of the set to the indicated location in an Array. (Inherited from PermissionSet.) |
![]() | Demand | Forces 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.) |
![]() | Deny | 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.) |
![]() | Equals | Determines whether the specified PermissionSet or NamedPermissionSet object is equal to the current PermissionSet. (Inherited from PermissionSet.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | FromXml | Reconstructs a security object with a specified state from an XML encoding. (Overrides PermissionSet::FromXml(SecurityElement).) |
![]() | GetEnumerator | Returns an enumerator for the permissions of the set. (Inherited from PermissionSet.) |
![]() | GetEnumeratorImpl | Returns an enumerator for the permissions of the set. (Inherited from PermissionSet.) |
![]() | GetHashCode | Gets 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.) |
![]() | GetPermission | Gets a permission object of the specified type, if it exists in the set. (Inherited from PermissionSet.) |
![]() | GetPermissionImpl | Gets a permission object of the specified type, if it exists in the set. (Inherited from PermissionSet.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Intersect | Creates and returns a permission set that is the intersection of the current PermissionSet and the specified PermissionSet. (Inherited from PermissionSet.) |
![]() | IsEmpty | Gets a value indicating whether the PermissionSet is empty. (Inherited from PermissionSet.) |
![]() | IsSubsetOf | Determines whether the current PermissionSet is a subset of the specified PermissionSet. (Inherited from PermissionSet.) |
![]() | IsUnrestricted | Determines whether the PermissionSet is Unrestricted. (Inherited from PermissionSet.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | PermitOnly | Causes 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.) |
![]() | RemovePermission | Removes a permission of a certain type from the set. (Inherited from PermissionSet.) |
![]() | RemovePermissionImpl | Removes a permission of a certain type from the set. (Inherited from PermissionSet.) |
![]() | SetPermission | Sets a permission to the PermissionSet, replacing any existing permission of the same type. (Inherited from PermissionSet.) |
![]() | SetPermissionImpl | Sets a permission to the PermissionSet, replacing any existing permission of the same type. (Inherited from PermissionSet.) |
![]() | ToString | Returns a string representation of the PermissionSet. (Inherited from PermissionSet.) |
![]() | ToXml | Creates an XML encoding of the security object and its current state. (Overrides PermissionSet::ToXml().) |
![]() | Union | Creates a PermissionSet that is the union of the current PermissionSet and the specified PermissionSet. (Inherited from PermissionSet.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDeserializationCallback::OnDeserialization | Infrastructure. Runs when the entire object graph has been deserialized. (Inherited from PermissionSet.) |
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.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
