System.Security.Permissions.PrincipalPermission.Union Method

Creates a permission that is the union of the current permission and the specified permission.

Syntax

public System.Security.IPermission Union (System.Security.IPermission other)

Parameters

other
A permission to combine with the current permission. It must be of the same type as the current permission.

Returns

A new permission that represents the union of the current permission and the specified permission.

Remarks

PrincipalPermission.Union(System.Security.IPermission) creates a permission representing the criteria of a given set of individual System.Security.Permissions.PrincipalPermission objects. It is useful for compactly representing a set of conditions to test. For example, with the declarations

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

(ppBob.Union(ppLouise)).Demand() will succeed if the current principal represents Bob in the role of Administrator or Louise in the role of Administrator.

Requirements

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