public bool IsSubsetOf(IPermission target) { if (target == null) { return(false); } CustomPermission other = target as CustomPermission; if (other == null) { throw new ArgumentException("Wrong type specified. Expecting CustomPermission", "target"); } return(other.permissionName.Equals(permissionName)); }
public IPermission Intersect(IPermission target) { if (target == null) { return(null); } CustomPermission other = target as CustomPermission; if (other == null) { throw new ArgumentException("Wrong type specified. Expecting CustomPermission", "target"); } if (other.permissionName.Equals(permissionName)) { return(new CustomPermission(permissionName)); } return(null); }