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