summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-09-02 10:47:08 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-09-02 16:36:20 +0200
commit34220fcd9417ffc286f55c0c77b035dc5c64ec7d (patch)
treea84497e5c13c134e4da0d2f099873eac2117d2a2 /server
parenta336f01a713914aba816eeef2ac8f95be9a60876 (diff)
downloadsonarqube-34220fcd9417ffc286f55c0c77b035dc5c64ec7d.tar.gz
sonarqube-34220fcd9417ffc286f55c0c77b035dc5c64ec7d.zip
Use WsProjectRef instead of Request to get a project
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionDependenciesFinder.java5
2 files changed, 3 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java
index d449c7d416e..ef3039d7f61 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java
@@ -32,8 +32,8 @@ import org.sonar.server.permission.PermissionService;
import static java.util.Collections.singletonList;
import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
-import static org.sonar.server.permission.ws.Parameters.createProjectParameter;
import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.createProjectParameter;
public class ApplyTemplateAction implements PermissionsWsAction {
private final DbClient dbClient;
@@ -67,7 +67,7 @@ public class ApplyTemplateAction implements PermissionsWsAction {
DbSession dbSession = dbClient.openSession(false);
try {
PermissionTemplateDto template = finder.getTemplate(dbSession, templateUuid);
- ComponentDto project = finder.getProject(dbSession, wsRequest);
+ ComponentDto project = finder.getProject(dbSession, WsProjectRef.fromRequest(wsRequest));
ApplyPermissionTemplateQuery query = ApplyPermissionTemplateQuery.create(
template.getUuid(),
diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionDependenciesFinder.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionDependenciesFinder.java
index 0fee0e31258..5faf1d2dbef 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionDependenciesFinder.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionDependenciesFinder.java
@@ -22,7 +22,6 @@ package org.sonar.server.permission.ws;
import com.google.common.base.Optional;
import javax.annotation.CheckForNull;
-import org.sonar.api.server.ws.Request;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.component.ComponentDto;
@@ -57,9 +56,7 @@ public class PermissionDependenciesFinder {
return Optional.of(componentFinder.getProjectByUuidOrKey(dbSession, wsProjectRef.uuid(), wsProjectRef.key()));
}
- public ComponentDto getProject(DbSession dbSession, Request wsRequest) {
- WsProjectRef projectRef = WsProjectRef.fromRequest(wsRequest);
-
+ public ComponentDto getProject(DbSession dbSession, WsProjectRef projectRef) {
return componentFinder.getProjectByUuidOrKey(dbSession, projectRef.uuid(), projectRef.key());
}