System.Security.Permissions.PrincipalPermission.Intersect Method

Creates and returns a permission that is the intersection of the current permission and the specified permission.

Syntax

public System.Security.IPermission Intersect (System.Security.IPermission target)

Parameters

target
A permission to intersect with the current permission. It must be of the same type as the current permission.

Returns

A new permission that represents the intersection of the current permission and the specified permission. This new permission will be null if the intersection is empty.

Remarks

Because two users never intersect, this method is not useful for System.Security.Permissions.PrincipalPermission. For example,

code reference: System.Security.Permissions.PrincipalPermission#1

is equivalent to

code reference: System.Security.Permissions.PrincipalPermission#2

because no identity can simultaneously represent both Bob and Louise. In effect, pp1.Demand() only succeeds if an unauthenticated principal (with name equal to the empty string ("")) is allowed to act in the Administrator role.

Requirements

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0