]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6503 SONAR-6500 SONAR-6502 SONAR-6501 Update permission parameter description...
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 25 Aug 2015 09:33:45 +0000 (11:33 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 25 Aug 2015 09:33:45 +0000 (11:33 +0200)
server/sonar-server/src/main/java/org/sonar/server/permission/ws/AddGroupToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/AddUserToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/Parameters.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/RemoveGroupFromTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/RemoveUserFromTemplateAction.java

index ee330decfac79e057105684cc25a9e5f8fe705c2..c579546a7c2e948c41c9a7c1a81b2e443b1fdd01 100644 (file)
@@ -40,7 +40,7 @@ import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
 import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
 
 public class AddGroupToTemplateAction implements PermissionsWsAction {
@@ -66,7 +66,7 @@ public class AddGroupToTemplateAction implements PermissionsWsAction {
       .setHandler(this);
 
     createTemplateKeyParameter(action);
-    createPermissionParameter(action);
+    createProjectPermissionParameter(action);
     createGroupIdParameter(action);
     createGroupNameParameter(action);
   }
index 01ae1255d4c6afa6519240693be8f7c4b1b5c1de..510bbac1f52c154257a0ab7accb2bccc7102bb63 100644 (file)
@@ -40,7 +40,7 @@ import static org.sonar.server.permission.PermissionRequestValidator.validatePro
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
 import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
 import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
 
@@ -66,7 +66,7 @@ public class AddUserToTemplateAction implements PermissionsWsAction {
       .setHandler(this);
 
     createTemplateKeyParameter(action);
-    createPermissionParameter(action);
+    createProjectPermissionParameter(action);
     createUserLoginParameter(action);
   }
 
index 79eb9c1333add8a67ae1cc7c5091816bcca6e42b..e15cd93a0798897df766916a40fd588b804d9b3b 100644 (file)
@@ -21,8 +21,8 @@
 package org.sonar.server.permission.ws;
 
 import org.sonar.api.server.ws.WebService.NewAction;
-import org.sonar.core.permission.ProjectPermissions;
 import org.sonar.core.permission.GlobalPermissions;
+import org.sonar.core.permission.ProjectPermissions;
 
 class Parameters {
 
@@ -41,6 +41,11 @@ class Parameters {
     "</ul>",
     GlobalPermissions.ALL_ON_ONE_LINE,
     ProjectPermissions.ALL_ON_ONE_LINE);
+  private static final String PROJECT_PERMISSION_PARAM_DESCRIPTION = String.format("Permission" +
+    "<ul>" +
+    "<li>Possible values for project permissions %s</li>" +
+    "</ul>",
+    ProjectPermissions.ALL_ON_ONE_LINE);
 
   private Parameters() {
     // static methods only
@@ -52,6 +57,12 @@ class Parameters {
       .setRequired(true);
   }
 
+  static void createProjectPermissionParameter(NewAction action) {
+    action.createParam(PARAM_PERMISSION)
+      .setDescription(PROJECT_PERMISSION_PARAM_DESCRIPTION)
+      .setRequired(true);
+  }
+
   static void createGroupNameParameter(NewAction action) {
     action.createParam(PARAM_GROUP_NAME)
       .setDescription("Group name or 'anyone' (case insensitive)")
index f5f156779f50d886fb32a408dcbbd85fbadb6050..79147e7cf33886024ea779345a08dd49f8cbe8f4 100644 (file)
@@ -35,7 +35,7 @@ import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
 import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
 
 public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
@@ -61,7 +61,7 @@ public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
       .setHandler(this);
 
     createTemplateKeyParameter(action);
-    createPermissionParameter(action);
+    createProjectPermissionParameter(action);
     createGroupIdParameter(action);
     createGroupNameParameter(action);
   }
index 7b2857e21ef5421d0cbda9ee8e918423f7fb6a17..0c0c9742436db950b475820039e6eb72fcfa2127 100644 (file)
@@ -34,7 +34,7 @@ import static org.sonar.server.permission.PermissionRequestValidator.validatePro
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_KEY;
 import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
-import static org.sonar.server.permission.ws.Parameters.createPermissionParameter;
+import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
 import static org.sonar.server.permission.ws.Parameters.createTemplateKeyParameter;
 import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
 
@@ -60,7 +60,7 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction {
       .setHandler(this);
 
     createTemplateKeyParameter(action);
-    createPermissionParameter(action);
+    createProjectPermissionParameter(action);
     createUserLoginParameter(action);
   }