diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2018-01-03 11:19:14 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk@users.noreply.github.com> | 2018-01-04 11:24:04 +0100 |
commit | 3acbe2a620ec2a188987047e456e925e7fd9f559 (patch) | |
tree | b6032962626e8a4d124d2950295a320856282bf0 /server | |
parent | 6b22d0d487f1abe6bf9ef940183da40b9986cab9 (diff) | |
download | sonarqube-3acbe2a620ec2a188987047e456e925e7fd9f559.tar.gz sonarqube-3acbe2a620ec2a188987047e456e925e7fd9f559.zip |
SONAR-10218 Fix permissions document of api/custom_measures/create
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/measure/custom/ws/CreateAction.java | 2 | ||||
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/custom/ws/CreateAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/custom/ws/CreateAction.java index 0453dfcc850..e24c5ef9c73 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/custom/ws/CreateAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/custom/ws/CreateAction.java @@ -72,7 +72,7 @@ public class CreateAction implements CustomMeasuresWsAction { WebService.NewAction action = context.createAction(ACTION) .setDescription("Create a custom measure.<br /> " + "The project id or the project key must be provided (only project and module custom measures can be created). The metric id or the metric key must be provided.<br/>" + - "Requires 'Administer System' permission or 'Administer' permission on the project.") + "Requires 'Administer' permission on the project.") .setSince("5.2") .setPost(true) .setHandler(this); diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java index a88e7b02db7..b5dc9de05d7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java @@ -40,6 +40,7 @@ import org.sonar.db.measure.custom.CustomMeasureDto; import org.sonar.db.metric.MetricDto; import org.sonar.db.metric.MetricTesting; import org.sonar.db.organization.OrganizationDto; +import org.sonar.db.permission.OrganizationPermission; import org.sonar.db.user.UserDto; import org.sonar.server.component.TestComponentFinder; import org.sonar.server.es.EsTester; @@ -435,8 +436,8 @@ public class CreateActionTest { } @Test - public void fail_when_not_project_administrator() throws Exception { - userSession.logIn(); + public void fail_when_system_administrator() throws Exception { + userSession.logIn().setSystemAdministrator().addPermission(OrganizationPermission.ADMINISTER, db.getDefaultOrganization()); MetricDto metric = insertMetric(STRING); expectedException.expect(ForbiddenException.class); |