Export (0) Print
Expand All

IPermission.IsSubsetOf Method

Determines whether the current permission is a subset of the specified permission.

[Visual Basic]
Function IsSubsetOf( _
   ByVal target As IPermission _
) As Boolean
[C#]
bool IsSubsetOf(
   IPermission target
);
[C++]
bool IsSubsetOf(
   IPermission* target
);
[JScript]
function IsSubsetOf(
   target : IPermission
) : Boolean;

Parameters

target
A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.

Return Value

true if the current permission is a subset of the specified permission; otherwise, false.

Exceptions

Exception Type Condition
ArgumentException The target parameter is not a null reference (Nothing in Visual Basic) and is not of the same type as the current permission.

Remarks

The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to C:\example.txt is a subset of a permission that represents access to C:\. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

The following statements are required to be true for all implementations of the IsSubsetOf method. X, Y, and Z represent IPermission objects that are not a null reference (Nothing in Visual Basic).

  • 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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

IPermission Interface | IPermission Members | System.Security Namespace

Show:
© 2014 Microsoft