public override bool CanExecute() { if (AsMember.IsOwner) { return(true); } if (!MemberPermissions.Has(Permission.Administrator, Permission.ManageRoles)) { return(false); } var memberHighestRole = GetRoleWithHighestPriority(MemberRoles); if (AddedRole.Priority >= memberHighestRole.Priority) { return(false); } if (!MemberPermissions.Has(Permission.Administrator) && !MemberPermissions.Has(AddedPermission)) { return(false); } return(true); }
public override bool CanExecute() { if (AsMember.IsOwner) { return(true); } if (!MemberPermissions.Has(Permission.Administrator, Permission.ManageRoles)) { return(false); } var highestRole = GetRoleWithHighestPriority(MemberRoles); return(highestRole.Priority > AssignedRole.Priority); }