@Override
  public void handle(Request request, Response response) throws Exception {
    userSession.checkGlobalPermission(UserRole.ADMIN);
    List<String> uuids = request.paramAsStrings(PARAM_IDS);
    List<String> keys = request.paramAsStrings(PARAM_KEYS);

    DbSession dbSession = dbClient.openSession(false);
    try {
      List<ComponentDto> projects = searchProjects(dbSession, uuids, keys);
      componentCleanerService.delete(dbSession, projects);
    } finally {
      MyBatis.closeQuietly(dbSession);
    }

    response.noContent();
  }
 private void checkPermission() {
   userSession.checkGlobalPermission(GlobalPermissions.SYSTEM_ADMIN);
 }
 private void checkPermission(UserSession userSession) {
   userSession.checkLoggedIn();
   userSession.checkGlobalPermission(GlobalPermissions.QUALITY_PROFILE_ADMIN);
 }