[Serializable] |
ctor #1 | Overloaded:.ctor(NamedPermissionSet permSet) Initializes a new instance of the NamedPermissionSet class from another named permission set. |
ctor #2 | Overloaded:.ctor(string name) Initializes a new, empty instance of the NamedPermissionSet class with the specified name. |
ctor #3 | Overloaded:.ctor(string name, PermissionSet permSet) Initializes a new instance of the NamedPermissionSet class with the specified name from a permission set. |
ctor #4 | Overloaded:.ctor(string name, PermissionState state) Initializes a new instance of the NamedPermissionSet class with the specified name in either an unrestricted or a fully restricted state. |
Count (inherited from System.Security.PermissionSet) |
Read-only See base class member description: System.Security.PermissionSet.Count Gets the number of permission objects contained in the permission set. |
Description | Read-write Gets or sets the text description of the current named permission set. |
IsReadOnly (inherited from System.Security.PermissionSet) |
Read-only See base class member description: System.Security.PermissionSet.IsReadOnly Gets a value indicating whether the collection is read-only. |
IsSynchronized (inherited from System.Security.PermissionSet) |
Read-only See base class member description: System.Security.PermissionSet.IsSynchronized Gets a value indicating whether the collection is guaranteed to be thread safe. |
Name | Read-write Gets or sets the name of the current named permission set. |
SyncRoot (inherited from System.Security.PermissionSet) |
Read-only See base class member description: System.Security.PermissionSet.SyncRoot Gets the root object of the current collection. |
AddPermission (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.AddPermission Adds a specified permission to the PermissionSet. |
Assert (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.Assert Asserts that the calling code can access the resource contained in the set through the code that calls this method, even if callers higher in the stack have not been granted permission to access the resource. |
ContainsNonCodeAccessPermissions (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.ContainsNonCodeAccessPermissions Gets a value indicating whether the PermissionSet contains permissions that are not derived from CodeAccessPermission. |
Copy | Overloaded:Copy() Overridden: Creates a permission set copy from a named permission set. |
Copy | Overloaded:Copy(string name) Creates a copy of the named permission set with a different name but the same permissions. |
CopyTo (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.CopyTo Copies the permission objects of the set to the indicated location in an Array. |
Demand (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.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. |
Deny (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.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 PermissionSet to fail. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
FromXml | Overridden: Reconstructs a named permission set with a specified state from an XML encoding. |
GetEnumerator (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.GetEnumerator Returns an enumerator for the permissions of the set. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetPermission (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.GetPermission Gets a permission object of the specified type, if it exists in the set. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
Intersect (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.Intersect Creates and returns a permission that is the intersection of the current PermissionSet and the specified PermissionSet. |
IsEmpty (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.IsEmpty Gets a value indicating whether the PermissionSet is empty. |
IsSubsetOf (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.IsSubsetOf Determines whether the current PermissionSet is a subset of the specified PermissionSet. |
IsUnrestricted (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.IsUnrestricted Determines whether the PermissionSet is Unrestricted. |
PermitOnly (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.PermitOnly Causes any PermissionSet.Demand that passes through the calling code for any PermissionSet that is not a subset of the current PermissionSet to fail. |
RemovePermission (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.RemovePermission Removes a permission of a certain type from the set. |
SetPermission (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.SetPermission Sets a permission to the PermissionSet, replacing any existing permission of the same type. |
ToString (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.ToString Returns a string representation of the PermissionSet. |
ToXml | Overridden: Creates an XML element description of the named permission set. |
Union (inherited from System.Security.PermissionSet) |
See base class member description: System.Security.PermissionSet.Union Creates a PermissionSet that is the union of the current PermissionSet and the specified PermissionSet. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public NamedPermissionSet(NamedPermissionSet( |
permSet
public NamedPermissionSet( |
name
Exception Type | Condition |
---|---|
ArgumentException | The name parameter is not a valid name (such as null or empty string ("")). |
public NamedPermissionSet( |
name
permSet
Exception Type | Condition |
---|---|
ArgumentException | The name parameter is not a valid name (such as null or empty string ("")). |
public NamedPermissionSet( |
name
state
Exception Type | Condition |
---|---|
ArgumentException | The name parameter is not a valid name (such as null or empty string ("")). |
public virtual int Count {get;}
|
public string Description {get; set;}
|
NamedPermissionSet namedpset = new NamedPermissionSet ("Empty"); namedpset.Description = "This permission set contains no permissions.";
public virtual bool IsReadOnly {get;}
|
public virtual bool IsSynchronized {get;}
|
This method is required to support ICollection.
public string Name {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentException | The name is not a valid name (such as null or empty string ("")). |
NamedPermissionSet namedpset = new NamedPermissionSet ("none"); namedpset.Name = "Empty"; // change name of permission set to "Empty"
public virtual object SyncRoot {get;}
|
public virtual IPermission AddPermission( |
perm
Exception Type | Condition |
---|---|
ArgumentException | The perm parameter is not a permission object. |
public virtual void Assert(); |
Exception Type | Condition |
---|---|
SecurityException | The PermissionSet instance asserted has not been granted to the asserting code. |
public bool ContainsNonCodeAccessPermissions(); |
public override PermissionSet Copy(); |
public NamedPermissionSet Copy( |
name
Exception Type | Condition |
---|---|
ArgumentException | The name parameter is not a valid name (such as null or empty string ("")). |
array
index
Exception Type | Condition |
---|---|
ArgumentException | The index parameter is out of the range of the array parameter. |
ArgumentNullException | The array parameter is null. |
public virtual void Demand(); |
Exception Type | Condition |
---|---|
SecurityException | A caller in the call chain does not have the permission demanded. |
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. PermissionSet.Demand succeeds only if no SecurityException is thrown.
If the PermissionSet contains permissions that do not inherit from CodeAccessPermission, the Demand methods of those permissions are called as well.
public virtual void Deny(); |
PermissionSet.Deny can limit the liability of the programmer or prevent accidental security vulnerabilities because it prevents the method that calls PermissionSet.Deny from being used to access the resource protected by the denied permission. If a method calls PermissionSet.Deny on a permission, and if a PermissionSet.Demand for that permission is invoked by a caller lower in the call stack, that security check fails when it reaches the PermissionSet.Deny.
PermissionSet.Deny is ignored for a permission that is not granted because a demand for that permission cannot succeed.
~NamedPermissionSet(); |
public override void FromXml( |
et
Exception Type | Condition |
---|---|
ArgumentException | The et parameter is not a valid representation of a named permission set. |
ArgumentNullException | The et parameter is null. |
public virtual IEnumerator GetEnumerator(); |
public virtual int GetHashCode(); |
public virtual IPermission GetPermission( |
permClass
public Type GetType(); |
public virtual PermissionSet Intersect( |
other
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 PermissionSet. Permission types that exist in only one of the two sets are excluded from the resulting set.
public virtual bool IsEmpty(); |
public virtual bool IsSubsetOf( |
target
public virtual bool IsUnrestricted(); |
protected object MemberwiseClone(); |
public virtual void PermitOnly(); |
PermissionSet.PermitOnly 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 PermissionSet.Demand for that permission, a SecurityException is thrown when the stack walk reaches the code that tried to call PermissionSet.PermitOnly. This is because the code that called PermissionSet.PermitOnly has not been granted the permission, even though it called PermissionSet.PermitOnly 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.
public virtual IPermission RemovePermission( |
permClass
public virtual IPermission SetPermission( |
perm
public override string ToString(); |
public override SecurityElement ToXml(); |
public virtual PermissionSet Union( |
other