diff options
3 files changed, 8 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsParametersBuilder.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsParametersBuilder.java index ebc2956e146..3c12d7f0e5d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsParametersBuilder.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/PermissionsWsParametersBuilder.java @@ -49,7 +49,7 @@ public class PermissionsWsParametersBuilder { "</ul>", GlobalPermissions.ALL_ON_ONE_LINE, ProjectPermissions.ALL_ON_ONE_LINE); - private static final String PROJECT_PERMISSION_PARAM_DESCRIPTION = format("Permission" + + public static final String PROJECT_PERMISSION_PARAM_DESCRIPTION = format("Permission" + "<ul>" + "<li>Possible values for project permissions %s</li>" + "</ul>", @@ -65,11 +65,15 @@ public class PermissionsWsParametersBuilder { .setRequired(true); } - public static NewParam createProjectPermissionParameter(NewAction action) { + public static NewParam createProjectPermissionParameter(NewAction action, boolean required) { return action.createParam(PARAM_PERMISSION) .setDescription(PROJECT_PERMISSION_PARAM_DESCRIPTION) .setPossibleValues(ProjectPermissions.ALL) - .setRequired(true); + .setRequired(required); + } + + public static NewParam createProjectPermissionParameter(NewAction action) { + return createProjectPermissionParameter(action, true); } public static void createGroupNameParameter(NewAction action) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/TemplateGroupsAction.java b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/TemplateGroupsAction.java index ab2ec105106..cac5eea701c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/TemplateGroupsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/ws/template/TemplateGroupsAction.java @@ -83,7 +83,7 @@ public class TemplateGroupsAction implements PermissionsWsAction { "When this parameter is not set, only group having at least one permission are returned.") .setExampleValue("eri"); - createProjectPermissionParameter(action); + createProjectPermissionParameter(action, false); createTemplateParameters(action); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java index e3675357ce8..b3afa0bf7f5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/PermissionsWsTest.java @@ -76,7 +76,6 @@ public class PermissionsWsTest { assertThat(action.isPost()).isFalse(); assertThat(action.isInternal()).isTrue(); assertThat(action.since()).isEqualTo("5.2"); - assertThat(action.param(PARAM_PERMISSION).isRequired()).isTrue(); } private WebService.Controller controller() { |