Пример #1
0
 public void RemoveRole(AuthUser authUser, Role role)
 {
     if (role.Rolename == Role.ADMIN_ROLENAME && AuthUser.PROTECTED_USERS.Contains(authUser.Username))
     {
         throw new ManualValidationException("You can't remove the admin role from protected users.");
     }
     authUser.RemoveRole(role.Id);
 }