]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8608 fix name of constant PARAM_ORGANIZATION_KEY 1621/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 6 Feb 2017 15:11:27 +0000 (16:11 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 7 Feb 2017 08:31:51 +0000 (09:31 +0100)
25 files changed:
server/sonar-server/src/main/java/org/sonar/server/permission/ws/AddUserAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/GroupsAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionWsSupport.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsParametersBuilder.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/RemoveUserAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/SearchGlobalPermissionsAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/UsersAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddProjectCreatorToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/AddUserToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/BulkApplyTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/CreateTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/DeleteTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveProjectCreatorFromTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SearchTemplatesAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/SetDefaultTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/WsTemplateRef.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/BulkApplyTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/DeleteTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java
sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsWsParameters.java

index 2534304e2073e1c2ff550f1ffbdd9db623bad87e..37bcee9f00a4b324028c5a71432795d0b00c15f0 100644 (file)
@@ -42,7 +42,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
 
@@ -87,7 +87,7 @@ public class AddUserAction implements PermissionsWsAction {
     try (DbSession dbSession = dbClient.openSession(false)) {
       UserId user = support.findUser(dbSession, request.mandatoryParam(PARAM_USER_LOGIN));
       Optional<ComponentDto> project = support.findProject(dbSession, request);
-      String organizationKey = request.param(PARAM_ORGANIZATION_KEY);
+      String organizationKey = request.param(PARAM_ORGANIZATION);
       checkArgument(!project.isPresent() || organizationKey == null, "Organization must not be set when project is set.");
       OrganizationDto org = project
         .map(dto -> dbClient.organizationDao().selectByUuid(dbSession, dto.getOrganizationUuid()))
index c1e622b19439e3a69e40605c80a1ad8006e6e99e..aba2639f66dfffbd3615a6c395076c03d02eb329 100644 (file)
@@ -53,7 +53,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 
 public class GroupsAction implements PermissionsWsAction {
@@ -94,7 +94,7 @@ public class GroupsAction implements PermissionsWsAction {
   @Override
   public void handle(Request request, Response response) throws Exception {
     try (DbSession dbSession = dbClient.openSession(false)) {
-      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
       Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
       checkProjectAdmin(userSession, org.getUuid(), projectId);
 
index faf6cbb7829e44133c71034afcc73e164ff2e471..278316b9e1f6714561505737de0dcc4812f26393 100644 (file)
@@ -41,7 +41,7 @@ import org.sonarqube.ws.client.permission.PermissionsWsParameters;
 import static org.sonar.server.ws.WsUtils.checkFound;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 
 public class PermissionWsSupport {
 
@@ -90,7 +90,7 @@ public class PermissionWsSupport {
 
   public GroupIdOrAnyone findGroup(DbSession dbSession, Request request) {
     Long groupId = request.paramAsLong(PARAM_GROUP_ID);
-    String orgKey = request.param(PARAM_ORGANIZATION_KEY);
+    String orgKey = request.param(PARAM_ORGANIZATION);
     String groupName = request.param(PARAM_GROUP_NAME);
     GroupWsRef groupRef = GroupWsRef.create(groupId, orgKey, groupName);
     return groupWsSupport.findGroupOrAnyone(dbSession, groupRef);
index fcb0f6284d2eba6122e3b657c264548f262330d8..0db8db4bed84db27276797ded634be95fd2b9b58 100644 (file)
@@ -31,7 +31,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_D
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ID;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
@@ -79,7 +79,7 @@ public class PermissionsWsParametersBuilder {
   }
 
   public static void createOrganizationParameter(NewAction action) {
-    action.createParam(PARAM_ORGANIZATION_KEY)
+    action.createParam(PARAM_ORGANIZATION)
       .setDescription("Key of organization, used when group name is set")
       .setExampleValue("my-org")
       .setSince("6.2")
index 8dffdecc73605913963ae5c85c8e2871896c035c..2de4c2497b3dfa9dd7dce8ec1a03e81987e8fe49 100644 (file)
@@ -39,7 +39,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
 
@@ -84,7 +84,7 @@ public class RemoveUserAction implements PermissionsWsAction {
     try (DbSession dbSession = dbClient.openSession(false)) {
       UserId user = support.findUser(dbSession, request.mandatoryParam(PARAM_USER_LOGIN));
       Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
-      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
 
       checkProjectAdmin(userSession, org.getUuid(), projectId);
 
index ce460ef57d42743844bfa4c7fddbf5c1262d334f..74f2f6facda207eb3ea69961d7553c49eb473f0b 100644 (file)
@@ -37,7 +37,7 @@ import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobal
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createOrganizationParameter;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 import static org.sonarqube.ws.WsPermissions.Permission.newBuilder;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 
 public class SearchGlobalPermissionsAction implements PermissionsWsAction {
 
@@ -72,7 +72,7 @@ public class SearchGlobalPermissionsAction implements PermissionsWsAction {
   @Override
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     try (DbSession dbSession = dbClient.openSession(false)) {
-      OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION_KEY));
+      OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION));
       checkGlobalAdmin(userSession, org.getUuid());
 
       WsSearchGlobalPermissionsResponse response = buildResponse(dbSession, org);
index 99d011614a8cd986daacb35c1556bdfc14a889e9..eb295d081b78b1cc5a1e300519c273994ae0640a 100644 (file)
@@ -54,7 +54,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectParameters;
 import static org.sonar.server.ws.WsUtils.checkRequest;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 
 public class UsersAction implements PermissionsWsAction {
@@ -99,7 +99,7 @@ public class UsersAction implements PermissionsWsAction {
   @Override
   public void handle(Request request, Response response) throws Exception {
     try (DbSession dbSession = dbClient.openSession(false)) {
-      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION_KEY));
+      OrganizationDto org = support.findOrganization(dbSession, request.param(PARAM_ORGANIZATION));
       Optional<ProjectId> projectId = support.findProjectId(dbSession, request);
       checkProjectAdmin(userSession, org.getUuid(), projectId);
 
index b1c6db512f934617e257f867c340bdca9652a568..df646f1874bbbfcf711036273c550f3a654dfaa3 100644 (file)
@@ -38,7 +38,7 @@ import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobal
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -60,7 +60,7 @@ public class AddProjectCreatorToTemplateAction implements PermissionsWsAction {
     AddProjectCreatorToTemplateWsRequest wsRequest = AddProjectCreatorToTemplateWsRequest.builder()
       .setPermission(request.mandatoryParam(PARAM_PERMISSION))
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME))
       .build();
     validateProjectPermission(wsRequest.getPermission());
index c1b20ddca0d1c304269cc80813e772a327ef5bff..ee5b79d6f80f4a95d0c3552f3e131b885847a035 100644 (file)
@@ -39,7 +39,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
 import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -61,7 +61,7 @@ public class AddUserToTemplateAction implements PermissionsWsAction {
       .setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
       .setPermission(request.mandatoryParam(PARAM_PERMISSION))
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME));
   }
 
index 3634f286fd02fd855230a576145a401282b86dc0..12748057c1d012df2bb236f343c1e0b9fcb1650a 100644 (file)
@@ -46,7 +46,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
 import static org.sonar.server.ws.WsParameterBuilder.createRootQualifierParameter;
 import static org.sonar.server.ws.WsParameterBuilder.QualifierParameterContext.newQualifierParameterContext;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -73,7 +73,7 @@ public class BulkApplyTemplateAction implements PermissionsWsAction {
   private static BulkApplyTemplateWsRequest toBulkApplyTemplateWsRequest(Request request) {
     return new BulkApplyTemplateWsRequest()
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME))
       .setQualifier(request.param(PARAM_QUALIFIER))
       .setQuery(request.param(Param.TEXT_QUERY));
index 45510ea2a835abf195496fd98672c06744ba69ca..43bcc41c316471e25b2e6d3ad240db836541fe9f 100644 (file)
@@ -50,7 +50,7 @@ import static org.sonar.server.ws.WsUtils.checkRequest;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_DESCRIPTION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY_PATTERN;
 
 public class CreateTemplateAction implements PermissionsWsAction {
@@ -71,7 +71,7 @@ public class CreateTemplateAction implements PermissionsWsAction {
       .setName(request.mandatoryParam(PARAM_NAME))
       .setDescription(request.param(PARAM_DESCRIPTION))
       .setProjectKeyPattern(request.param(PARAM_PROJECT_KEY_PATTERN))
-      .setOrganizationKey(request.param(PARAM_ORGANIZATION_KEY));
+      .setOrganizationKey(request.param(PARAM_ORGANIZATION));
   }
 
   private static CreateTemplateWsResponse buildResponse(PermissionTemplateDto permissionTemplateDto) {
index 1a42c04774c9d3c033142ffbad9f23f7aaeee9ae..2cd486e547760de063c8d2c47dd2f2fc3f802023 100644 (file)
@@ -37,7 +37,7 @@ import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.crea
 import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateRef;
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
 import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
 
@@ -57,7 +57,7 @@ public class DeleteTemplateAction implements PermissionsWsAction {
   private static DeleteTemplateWsRequest toDeleteTemplateWsRequest(Request request) {
     return new DeleteTemplateWsRequest()
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME));
   }
 
index dab42553d70b8044e9445e00a4cb90d01ff50e63..dbd24182eaf0204463d28a83c05280969964f1f3 100644 (file)
@@ -38,7 +38,7 @@ import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobal
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -60,7 +60,7 @@ public class RemoveProjectCreatorFromTemplateAction implements PermissionsWsActi
     RemoveProjectCreatorFromTemplateWsRequest wsRequest = RemoveProjectCreatorFromTemplateWsRequest.builder()
       .setPermission(request.mandatoryParam(PARAM_PERMISSION))
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME))
       .build();
     validateProjectPermission(wsRequest.getPermission());
index ef29e13daab44689c7887dcaec7d0ba5745db861..70cdd9f3632849b720b18dbdde89c08153a6e8c6 100644 (file)
@@ -37,7 +37,7 @@ import static org.sonar.server.permission.ws.PermissionRequestValidator.validate
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createTemplateParameters;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createUserLoginParameter;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -59,7 +59,7 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction {
       .setPermission(request.mandatoryParam(PARAM_PERMISSION))
       .setLogin(request.mandatoryParam(PARAM_USER_LOGIN))
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME));
   }
 
index a4cab3f2c993307e9887a4575bf96ef5bb7203cc..481c60b6e3c23b8f0316eef731567312586da8fd 100644 (file)
@@ -47,7 +47,7 @@ import static org.sonar.core.util.Protobuf.setNullable;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdmin;
 import static org.sonar.server.permission.ws.PermissionsWsParametersBuilder.createOrganizationParameter;
 import static org.sonar.server.ws.WsUtils.writeProtobuf;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 
 public class SearchTemplatesAction implements PermissionsWsAction {
   private static final String PROPERTY_PREFIX = "projects_role.";
@@ -125,7 +125,7 @@ public class SearchTemplatesAction implements PermissionsWsAction {
   @Override
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     try (DbSession dbSession = dbClient.openSession(false)) {
-      OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION_KEY));
+      OrganizationDto org = support.findOrganization(dbSession, wsRequest.param(PARAM_ORGANIZATION));
       SearchTemplatesWsRequest request = new SearchTemplatesWsRequest()
         .setOrganizationUuid(org.getUuid())
         .setQuery(wsRequest.param(Param.TEXT_QUERY));
index b085f261b9fde0ef4c9c75bc0f18fbdbed521b2d..66f6799961f59429715b9d4dfcbb8e4e8ce1f37d 100644 (file)
@@ -43,7 +43,7 @@ import static org.sonar.server.permission.ws.template.WsTemplateRef.newTemplateR
 import static org.sonar.server.ws.WsParameterBuilder.createRootQualifierParameter;
 import static org.sonar.server.ws.WsParameterBuilder.QualifierParameterContext.newQualifierParameterContext;
 import static org.sonar.server.ws.WsUtils.checkFoundWithOptional;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -68,7 +68,7 @@ public class SetDefaultTemplateAction implements PermissionsWsAction {
     return new SetDefaultTemplateWsRequest()
       .setQualifier(request.param(PARAM_QUALIFIER))
       .setTemplateId(request.param(PARAM_TEMPLATE_ID))
-      .setOrganization(request.param(PARAM_ORGANIZATION_KEY))
+      .setOrganization(request.param(PARAM_ORGANIZATION))
       .setTemplateName(request.param(PARAM_TEMPLATE_NAME));
   }
 
index 596319f093cf39057583887c5e48f4844a0e1386..b18e0ef2d479a5b57e93f198cf6a0bb6d0ac367c 100644 (file)
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
 import org.sonar.api.server.ws.Request;
 
 import static org.sonar.server.ws.WsUtils.checkRequest;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
 
@@ -48,7 +48,7 @@ public class WsTemplateRef {
 
   public static WsTemplateRef fromRequest(Request wsRequest) {
     String uuid = wsRequest.param(PARAM_TEMPLATE_ID);
-    String organization = wsRequest.param(PARAM_ORGANIZATION_KEY);
+    String organization = wsRequest.param(PARAM_ORGANIZATION);
     String name = wsRequest.param(PARAM_TEMPLATE_NAME);
 
     return new WsTemplateRef(uuid, organization, name);
index f10aba1d3cf6a3b418c25e5c8462935f35f995aa..5627e61455c8c8fda83854ce5dc4389515773621 100644 (file)
@@ -39,7 +39,7 @@ import static org.sonar.db.component.ComponentTesting.newProjectDto;
 import static org.sonar.db.component.ComponentTesting.newView;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
@@ -74,7 +74,7 @@ public class AddGroupActionTest extends BasePermissionWsTest<AddGroupAction> {
     loginAsAdmin(org);
 
     newRequest()
-      .setParam(PARAM_ORGANIZATION_KEY, org.getKey())
+      .setParam(PARAM_ORGANIZATION, org.getKey())
       .setParam(PARAM_GROUP_NAME, group.getName())
       .setParam(PARAM_PERMISSION, PROVISIONING)
       .execute();
@@ -372,7 +372,7 @@ public class AddGroupActionTest extends BasePermissionWsTest<AddGroupAction> {
     newRequest()
       .setParam(PARAM_GROUP_NAME, groupDto.getName())
       .setParam(PARAM_PERMISSION, permission)
-      .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+      .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
       .execute();
   }
 
index 058e9f291230dfc46e2027db20cbdf9ee092df55..b5a6f0874b0c22d9aae6cc483ffc558a62559ef3 100644 (file)
@@ -38,7 +38,7 @@ import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.ComponentTesting.newProjectDto;
 import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
@@ -74,7 +74,7 @@ public class AddUserActionTest extends BasePermissionWsTest<AddUserAction> {
     OrganizationDto organization = db.organizations().insert();
     loginAsAdmin(organization);
     newRequest()
-      .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+      .setParam(PARAM_ORGANIZATION, organization.getKey())
       .setParam(PARAM_USER_LOGIN, user.getLogin())
       .setParam(PARAM_PERMISSION, SYSTEM_ADMIN)
       .execute();
@@ -343,7 +343,7 @@ public class AddUserActionTest extends BasePermissionWsTest<AddUserAction> {
     newRequest()
       .setParam(PARAM_USER_LOGIN, user.getLogin())
       .setParam(PARAM_PROJECT_KEY, project.getKey())
-      .setParam(PARAM_ORGANIZATION_KEY, "an_org")
+      .setParam(PARAM_ORGANIZATION, "an_org")
       .setParam(PARAM_PERMISSION, ISSUE_ADMIN)
       .execute();
   }
@@ -357,7 +357,7 @@ public class AddUserActionTest extends BasePermissionWsTest<AddUserAction> {
       .setParam(PARAM_USER_LOGIN, userDto.getLogin())
       .setParam(PARAM_PERMISSION, permission);
     if (organizationDto != null) {
-      request.setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey());
+      request.setParam(PARAM_ORGANIZATION, organizationDto.getKey());
     }
     request.execute();
   }
index 3a27d7ed396f0f7702cc8afa4132af46fd4482cf..92aa114c3fd6c60c1502bfead2d193235b03924d 100644 (file)
@@ -40,7 +40,7 @@ import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.ComponentTesting.newProjectDto;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
@@ -307,7 +307,7 @@ public class RemoveGroupActionTest extends BasePermissionWsTest<RemoveGroupActio
     newRequest()
       .setParam(PARAM_GROUP_NAME, groupDto.getName())
       .setParam(PARAM_PERMISSION, permission)
-      .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+      .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
       .execute();
   }
 
index aeea98ad732120d300f7a48d7ec39200d8b19a33..440d800309acf360048d41e92990e486055167a0 100644 (file)
@@ -40,7 +40,7 @@ import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.ComponentTesting.newProjectDto;
 import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
@@ -279,7 +279,7 @@ public class RemoveUserActionTest extends BasePermissionWsTest<RemoveUserAction>
     newRequest()
       .setParam(PARAM_USER_LOGIN, userDto.getLogin())
       .setParam(PARAM_PERMISSION, permission)
-      .setParam(PARAM_ORGANIZATION_KEY, organizationDto.getKey())
+      .setParam(PARAM_ORGANIZATION, organizationDto.getKey())
       .execute();
   }
 
index fa6bf340d2fdd0ebb43ab4826fbf09e5ee18617e..1daf93693ad547df19229fec3c34e7138188de6a 100644 (file)
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.sonar.db.component.ComponentTesting.newProjectDto;
 import static org.sonar.db.component.ComponentTesting.newView;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -116,7 +116,7 @@ public class BulkApplyTemplateActionTest extends BasePermissionWsTest<BulkApplyT
       + "' is not found (case insensitive) in organization with key '" + otherOrganization.getKey() + "'");
 
     newRequest()
-      .setParam(PARAM_ORGANIZATION_KEY, otherOrganization.getKey())
+      .setParam(PARAM_ORGANIZATION, otherOrganization.getKey())
       .setParam(PARAM_TEMPLATE_NAME, template1.getName())
       .execute();
   }
@@ -127,7 +127,7 @@ public class BulkApplyTemplateActionTest extends BasePermissionWsTest<BulkApplyT
     loginAsAdmin(organization);
 
     newRequest()
-      .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+      .setParam(PARAM_ORGANIZATION, organization.getKey())
       .setParam(PARAM_TEMPLATE_NAME, template1.getName())
       .execute();
 
index f02130782062385b69f7d8ba0269d7562ce0dfb2..dff44382e22c37febd58ae24c1cfb58404dcd667 100644 (file)
@@ -54,7 +54,7 @@ import org.sonar.server.ws.WsActionTester;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
 import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
 
@@ -425,7 +425,7 @@ public class DeleteTemplateActionTest {
   private TestResponse newRequestByName(WsActionTester actionTester, @Nullable String organizationKey, @Nullable String name) throws Exception {
     TestRequest request = actionTester.newRequest().setMethod("POST");
     if (organizationKey != null) {
-      request.setParam(PARAM_ORGANIZATION_KEY, organizationKey);
+      request.setParam(PARAM_ORGANIZATION, organizationKey);
     }
     if (name != null) {
       request.setParam(PARAM_TEMPLATE_NAME, name);
index ce5e5b703ba335713baba62cbe0c2aa818fb6a00..ab30a58a40344c5653bda8028d0d3f4d531892d5 100644 (file)
@@ -40,7 +40,7 @@ import org.sonar.server.ws.TestRequest;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.api.resources.Qualifiers.PROJECT;
 import static org.sonar.api.resources.Qualifiers.VIEW;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION_KEY;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
 import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
@@ -91,7 +91,7 @@ public class SetDefaultTemplateActionTest extends BasePermissionWsTest<SetDefaul
     loginAsAdmin(organization);
 
     newRequest()
-      .setParam(PARAM_ORGANIZATION_KEY, organization.getKey())
+      .setParam(PARAM_ORGANIZATION, organization.getKey())
       .setParam(PARAM_TEMPLATE_NAME, template.getName().toUpperCase())
       .execute();
     db.getSession().commit();
index 41f65e1d100718ae689a0304866a5f3349145dc1..86a9b4e102b86772abdd87d81f5d506852f1824c 100644 (file)
@@ -23,7 +23,7 @@ public class PermissionsWsParameters {
   public static final String CONTROLLER = "api/permissions";
 
   public static final String PARAM_PERMISSION = "permission";
-  public static final String PARAM_ORGANIZATION_KEY = "organization";
+  public static final String PARAM_ORGANIZATION = "organization";
   public static final String PARAM_GROUP_NAME = "groupName";
   public static final String PARAM_GROUP_ID = "groupId";
   public static final String PARAM_PROJECT_ID = "projectId";