diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-02-02 12:36:39 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-02-03 14:52:40 +0100 |
commit | 320223012bbfc3fcdfd8f8c5305c1ff2746c363a (patch) | |
tree | ed0974c4bd4a48290b67cab7d4765a4b240fae0a /sonar-db | |
parent | 0d6a493f0db7bc1ccf88c09c30cbcb9e4417383c (diff) | |
download | sonarqube-320223012bbfc3fcdfd8f8c5305c1ff2746c363a.tar.gz sonarqube-320223012bbfc3fcdfd8f8c5305c1ff2746c363a.zip |
SONAR-7242 Remove "Execute Preview Analysis" permission
Diffstat (limited to 'sonar-db')
7 files changed, 10 insertions, 12 deletions
diff --git a/sonar-db/src/main/java/org/sonar/core/permission/GlobalPermissions.java b/sonar-db/src/main/java/org/sonar/core/permission/GlobalPermissions.java index aa153c83276..b5ef8cdc158 100644 --- a/sonar-db/src/main/java/org/sonar/core/permission/GlobalPermissions.java +++ b/sonar-db/src/main/java/org/sonar/core/permission/GlobalPermissions.java @@ -34,14 +34,13 @@ public final class GlobalPermissions { public static final String QUALITY_GATE_ADMIN = "gateadmin"; public static final String DASHBOARD_SHARING = "shareDashboard"; public static final String SCAN_EXECUTION = "scan"; - public static final String PREVIEW_EXECUTION = "dryRunScan"; public static final String PROVISIONING = "provisioning"; /** * All the global permissions values, ordered from {@link #SYSTEM_ADMIN} to {@link #PROVISIONING}. */ public static final List<String> ALL = ImmutableList.of( - SYSTEM_ADMIN, QUALITY_PROFILE_ADMIN, QUALITY_GATE_ADMIN, DASHBOARD_SHARING, SCAN_EXECUTION, PREVIEW_EXECUTION, PROVISIONING); + SYSTEM_ADMIN, QUALITY_PROFILE_ADMIN, QUALITY_GATE_ADMIN, DASHBOARD_SHARING, SCAN_EXECUTION, PROVISIONING); public static final String ALL_ON_ONE_LINE = Joiner.on(", ").join(GlobalPermissions.ALL); private GlobalPermissions() { diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index 8689c67cc30..caa404a40ba 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -9,9 +9,8 @@ INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (2, 1, null, 'pr INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (3, 1, null, 'gateadmin'); INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (4, 1, null, 'shareDashboard'); INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (5, null, null, 'scan'); -INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (6, null, null, 'dryRunScan'); -INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (7, null, null, 'provisioning'); -INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (8, 1, null, 'provisioning'); +INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (6, null, null, 'provisioning'); +INSERT INTO GROUP_ROLES(ID, GROUP_ID, RESOURCE_ID, ROLE) VALUES (7, 1, null, 'provisioning'); ALTER TABLE GROUP_ROLES ALTER COLUMN ID RESTART WITH 9; INSERT INTO GROUPS_USERS(USER_ID, GROUP_ID) VALUES (1, 1); diff --git a/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java index aba3ec458a1..808b732d9f5 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java @@ -64,10 +64,10 @@ public class RoleDaoTest { GlobalPermissions.QUALITY_PROFILE_ADMIN, GlobalPermissions.DASHBOARD_SHARING); assertThat(underTest.selectGroupPermissions(db.getSession(), "sonar-users", null)).containsOnly(GlobalPermissions.DASHBOARD_SHARING); - assertThat(underTest.selectGroupPermissions(db.getSession(), DefaultGroups.ANYONE, null)).containsOnly(GlobalPermissions.PREVIEW_EXECUTION, + assertThat(underTest.selectGroupPermissions(db.getSession(), DefaultGroups.ANYONE, null)).containsOnly(GlobalPermissions.PROVISIONING, GlobalPermissions.SCAN_EXECUTION); - assertThat(underTest.selectGroupPermissions(db.getSession(), "anyone", null)).containsOnly(GlobalPermissions.PREVIEW_EXECUTION, GlobalPermissions.SCAN_EXECUTION); - assertThat(underTest.selectGroupPermissions(db.getSession(), "AnYoNe", null)).containsOnly(GlobalPermissions.PREVIEW_EXECUTION, GlobalPermissions.SCAN_EXECUTION); + assertThat(underTest.selectGroupPermissions(db.getSession(), "anyone", null)).containsOnly(GlobalPermissions.PROVISIONING, GlobalPermissions.SCAN_EXECUTION); + assertThat(underTest.selectGroupPermissions(db.getSession(), "AnYoNe", null)).containsOnly(GlobalPermissions.PROVISIONING, GlobalPermissions.SCAN_EXECUTION); } @Test diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId-result.xml index a9effb1ea47..6bfa48a7c78 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId-result.xml @@ -6,7 +6,7 @@ <group_roles id="4" group_id="101" role="shareDashboard" resource_id="[null]"/> <group_roles id="5" group_id="[null]" role="scan" resource_id="[null]"/> - <group_roles id="6" group_id="[null]" role="dryRunScan" resource_id="[null]"/> + <group_roles id="6" group_id="[null]" role="provisioning" resource_id="[null]"/> <group_roles id="7" group_id="102" role="admin" resource_id="1"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId.xml index f05b0aebecf..5de7bc48230 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId.xml @@ -11,7 +11,7 @@ <group_roles id="4" group_id="101" role="shareDashboard" resource_id="[null]"/> <group_roles id="5" group_id="[null]" role="scan" resource_id="[null]"/> - <group_roles id="6" group_id="[null]" role="dryRunScan" resource_id="[null]"/> + <group_roles id="6" group_id="[null]" role="provisioning" resource_id="[null]"/> <group_roles id="7" group_id="102" role="admin" resource_id="1"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions-result.xml index d87bfe95e07..a351f9d9de8 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions-result.xml @@ -9,7 +9,7 @@ <!-- Group 'anyone' has a NULL group_id --> <group_roles id="5" group_id="[null]" role="scan" resource_id="[null]"/> - <group_roles id="6" group_id="[null]" role="dryRunScan" resource_id="[null]"/> + <group_roles id="6" group_id="[null]" role="provisioning" resource_id="[null]"/> <group_roles id="7" group_id="102" role="admin" resource_id="1"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions.xml index 2e76afcd3be..812849436f1 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions.xml @@ -10,7 +10,7 @@ <!-- Group 'anyone' has a NULL group_id --> <group_roles id="5" group_id="[null]" role="scan" resource_id="[null]"/> - <group_roles id="6" group_id="[null]" role="dryRunScan" resource_id="[null]"/> + <group_roles id="6" group_id="[null]" role="provisioning" resource_id="[null]"/> <!-- Component permission, it should not be returned with global permissions --> <group_roles id="7" group_id="102" role="admin" resource_id="1"/> |