@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();
  }
예제 #2
0
 private void checkPermission() {
   userSession.checkGlobalPermission(GlobalPermissions.SYSTEM_ADMIN);
 }
예제 #3
0
 private void checkPermission(UserSession userSession) {
   userSession.checkLoggedIn();
   userSession.checkGlobalPermission(GlobalPermissions.QUALITY_PROFILE_ADMIN);
 }