public IPermission Union(IPermission other)
{
if (other == null)
{
return Copy();
}
else if (!VerifyType(other))
{
throw new ArgumentException(SR.Argument_WrongType, GetType().FullName);
}
PrincipalPermission operand = (PrincipalPermission)other;
if (IsUnrestricted() || operand.IsUnrestricted())
{
return new PrincipalPermission(PermissionState.Unrestricted);
}
IDRole[] idrolesArray = new IDRole[_idArray.Length + operand._idArray.Length];
Array.Copy(_idArray, 0, idrolesArray, 0, _idArray.Length);
Array.Copy(operand._idArray, 0, idrolesArray, _idArray.Length, operand._idArray.Length);
return new PrincipalPermission(idrolesArray);
}