Export (0) Print
Expand All

PrincipalPermission.Union Method

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

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)

public IPermission Union (
	IPermission other
)
public final IPermission Union (
	IPermission other
)
public final function Union (
	other : IPermission
) : IPermission

Parameters

other

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

Return Value

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

Exception typeCondition

ArgumentException

The other parameter is an object that is not of the same type as the current permission.

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

PrincipalPermission ppBob = new PrincipalPermission("Bob", "Administrator");
 PrincipalPermission ppLouise = new PrincipalPermission("Louise", "Administrator");

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft