Determines whether the current instance is a subset of the specified object.
- target
- A System.Security.IPermission object of the same type as the current instance that is to be tested for the subset relationship.
true if the current instance is a subset of target ; otherwise, false. If the current instance is unrestricted, and target is not, returns false. If target is unrestricted, returns true. If target is null and the current instance does not secure any resources or operations, returns true. If target is null and the current instance secures one or more resources or operations, returns false .
Type Reason ArgumentException target is not null and is not of the same type as the current instance.
The current instance is a subset of target if the current instance specifies a set of accesses to resources or operations that is wholly contained by target. For example, a permission that represents read access to a file is a subset of a permission that represents read and write access to the file.
Operation
If target is not null and is not of the same type as the current instance, a ArgumentException exception is required to be thrown.
The following statements are required to be true for all implementations of the IPermission.IsSubsetOf(IPermission) method. X, Y, and Z represent non-null System.Security.IPermission objects.
- X.IsSubsetOf(X ) returns true.
- X.IsSubsetOf(Y) returns the same value as Y.IsSubsetOf(X) if and only if X and Y represent the same set of permissions.
- if X.IsSubsetOf(Y) and Y.IsSubsetOf(Z ) both return true, X.IsSubsetOf(Z ) returns true.
Usage
Use this method to determine if the permissions described by the current instance are also described by the specified object.
Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0