ZoneIdentityPermission.Union Method (IPermission)

 

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 override IPermission Union(
	IPermission target
)

Parameters

target
Type: System.Security.IPermission

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

Return Value

Type: System.Security.IPermission

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

Exception Condition
ArgumentException

The target parameter is not null and is not of the same type as the current permission.

-or-

The two permissions are not equal and the current permission does not represent the NoZone security zone.

The result of a call to Union is a permission that represents the security zone represented by both the current permission and the specified permission. Any demand that passes either permission passes their union. The union of two identical ZoneIdentityPermission objects is the same permission. The union of a null permission and a ZoneIdentityPermission permission is the permission that is not null.

Note that aZoneIdentityPermission object representing a NoZone security zone is treated as a null permission and handled as a special case. The union of a ZoneIdentityPermission object representing the NoZone security zone and a null permission is null. The union of two different zone identity permissions results in an ArgumentException exception being thrown when neither of the two permissions represents the NoZone security zone.

.NET Framework
Available since 1.1
Return to top
Show: