Edit

Share via


SocketPermission.IsSubsetOf(IPermission) Method

Definition

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

public:
 override bool IsSubsetOf(System::Security::IPermission ^ target);
public override bool IsSubsetOf(System.Security.IPermission target);
override this.IsSubsetOf : System.Security.IPermission -> bool
Public Overrides Function IsSubsetOf (target As IPermission) As Boolean

Parameters

target
IPermission

A SocketPermission that is to be tested for the subset relationship.

Returns

If target is null, this method returns true if the current instance defines no permissions; otherwise, false. If target is not null, this method returns true if the current instance defines a subset of target permissions; otherwise, false.

Exceptions

DnsPermission is not granted to the method caller.

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 192.168.1.1:80 is a subset of a permission that represents access to 192.168.1.1:Any. If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

Applies to