aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-10-12 22:21:02 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-10-13 12:18:42 +0200
commit735f1b954cc98dc6bb9fba2416b494acbf68b79e (patch)
tree89ce9fe2f7e7984d0dabf6356a8a9a89a9ef2341 /sonar-db/src
parent73b71c9e8eb47c6d833cd5f4725be50719598b88 (diff)
downloadsonarqube-735f1b954cc98dc6bb9fba2416b494acbf68b79e.tar.gz
sonarqube-735f1b954cc98dc6bb9fba2416b494acbf68b79e.zip
SONAR-8134 add column group_roles.organization_uuid
Column is currently empty.
Diffstat (limited to 'sonar-db/src')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/permission/GroupPermissionDto.java14
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java2
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java5
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRoles.java45
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/permission/GroupPermissionMapper.xml2
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql1
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl1
-rw-r--r--sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest.java57
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml18
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/anonymous_should_be_authorized.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/group_should_be_authorized.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/is_authorized_component_key_for_global_permission.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_anonymous.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_group.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_group.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_user.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_anonymous.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_group_anyone.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_group_global_permissions.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_anonymous.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_group.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_user.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_user_global_permissions.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/user_should_be_authorized.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template-result.xml24
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id-result.xml24
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template-result.xml24
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_count_component_permissions.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_remove_all_permissions.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId-result.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/deleteGroupPermissionsByGroupId.xml21
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions-result.xml18
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/globalGroupPermissions.xml21
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions-result.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions.xml15
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_count_component_permissions.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_remove_all_permissions.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/countRoles.xml9
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId-result.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId.xml9
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest/previous-group_roles.sql6
53 files changed, 356 insertions, 118 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/permission/GroupPermissionDto.java b/sonar-db/src/main/java/org/sonar/db/permission/GroupPermissionDto.java
index a8c31ee2658..c42fb081a96 100644
--- a/sonar-db/src/main/java/org/sonar/db/permission/GroupPermissionDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/permission/GroupPermissionDto.java
@@ -21,10 +21,9 @@ package org.sonar.db.permission;
import javax.annotation.Nullable;
-/**
- * @since 3.2
- */
public class GroupPermissionDto {
+
+ private String organizationUuid;
private Long groupId;
private Long resourceId;
private String role;
@@ -33,6 +32,15 @@ public class GroupPermissionDto {
return groupId;
}
+ public String getOrganizationUuid() {
+ return organizationUuid;
+ }
+
+ public GroupPermissionDto setOrganizationUuid(String s) {
+ this.organizationUuid = s;
+ return this;
+ }
+
/**
* Null when Anyone
*/
diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
index 9c3956fe824..098c8257c1e 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
@@ -30,7 +30,7 @@ import org.sonar.db.MyBatis;
public class DatabaseVersion {
- public static final int LAST_VERSION = 1_414;
+ public static final int LAST_VERSION = 1_415;
/**
* The minimum supported version which can be upgraded. Lower
diff --git a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
index 36e9c61eedd..19ca38b34cf 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
@@ -160,6 +160,7 @@ import org.sonar.db.version.v61.PopulateTableProperties2;
import org.sonar.db.version.v61.RemoveViewsDefinitionFromProperties;
import org.sonar.db.version.v61.ShrinkModuleUuidPathOfProjects;
import org.sonar.db.version.v62.AddIsRootColumnOnTableUsers;
+import org.sonar.db.version.v62.AddOrganizationUuidToGroupRoles;
import org.sonar.db.version.v62.AddOrganizationUuidToGroups;
import org.sonar.db.version.v62.AddOrganizationUuidToPermissionTemplates;
import org.sonar.db.version.v62.AddOrganizationUuidToUserRoles;
@@ -368,6 +369,8 @@ public class MigrationStepModule extends Module {
PopulateOrganizationUuidOfUserRoles.class,
MakeOrganizationUuidNotNullOnUserRoles.class,
PopulateOrganizationUuidOfPermissionTemplates.class,
- MakeOrganizationUuidNotNullOnPermissionTemplates.class);
+ MakeOrganizationUuidNotNullOnPermissionTemplates.class,
+ AddOrganizationUuidToGroupRoles.class
+ );
}
}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRoles.java b/sonar-db/src/main/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRoles.java
new file mode 100644
index 00000000000..d7fe54f7a1d
--- /dev/null
+++ b/sonar-db/src/main/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRoles.java
@@ -0,0 +1,45 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.db.version.v62;
+
+import java.sql.SQLException;
+import org.sonar.db.Database;
+import org.sonar.db.version.AddColumnsBuilder;
+import org.sonar.db.version.DdlChange;
+import org.sonar.db.version.VarcharColumnDef;
+
+import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder;
+
+public class AddOrganizationUuidToGroupRoles extends DdlChange {
+
+ public AddOrganizationUuidToGroupRoles(Database db) {
+ super(db);
+ }
+
+ @Override
+ public void execute(Context context) throws SQLException {
+ VarcharColumnDef column = newVarcharColumnDefBuilder()
+ .setColumnName("organization_uuid")
+ .setIsNullable(true)
+ .setLimit(40)
+ .build();
+ context.execute(new AddColumnsBuilder(getDialect(), "group_roles").addColumn(column).build());
+ }
+}
diff --git a/sonar-db/src/main/resources/org/sonar/db/permission/GroupPermissionMapper.xml b/sonar-db/src/main/resources/org/sonar/db/permission/GroupPermissionMapper.xml
index 1d1e33d64d1..0cfd9472ff3 100644
--- a/sonar-db/src/main/resources/org/sonar/db/permission/GroupPermissionMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/permission/GroupPermissionMapper.xml
@@ -152,10 +152,12 @@
<insert id="insert" parameterType="GroupPermission" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
insert into group_roles (
+ organization_uuid,
group_id,
resource_id,
role
) values (
+ #{organizationUuid,jdbcType=VARCHAR},
#{groupId,jdbcType=BIGINT},
#{resourceId,jdbcType=BIGINT},
#{role,jdbcType=VARCHAR}
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 62b24e22a52..e1232a052ae 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
@@ -503,6 +503,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1411');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1412');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1413');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1414');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1415');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, IS_ROOT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', true, '1418215735482', '1418215735482');
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
index 35d4ac543a8..3c6211cb20e 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
+++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
@@ -99,6 +99,7 @@ CREATE TABLE "SCHEMA_MIGRATIONS" (
CREATE TABLE "GROUP_ROLES" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "ORGANIZATION_UUID" VARCHAR(40),
"GROUP_ID" INTEGER,
"RESOURCE_ID" INTEGER,
"ROLE" VARCHAR(64) NOT NULL
diff --git a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
index f28a1e17fde..acee005f4f7 100644
--- a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
@@ -29,6 +29,6 @@ public class MigrationStepModuleTest {
public void verify_count_of_added_MigrationStep_types() {
ComponentContainer container = new ComponentContainer();
new MigrationStepModule().configure(container);
- assertThat(container.size()).isEqualTo(156);
+ assertThat(container.size()).isEqualTo(157);
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest.java b/sonar-db/src/test/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest.java
new file mode 100644
index 00000000000..009d442b074
--- /dev/null
+++ b/sonar-db/src/test/java/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest.java
@@ -0,0 +1,57 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.db.version.v62;
+
+import java.sql.SQLException;
+import java.sql.Types;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.sonar.api.utils.System2;
+import org.sonar.db.DbTester;
+
+
+public class AddOrganizationUuidToGroupRolesTest {
+
+ @Rule
+ public final DbTester dbTester = DbTester.createForSchema(System2.INSTANCE, AddOrganizationUuidToGroupRolesTest.class, "previous-group_roles.sql");
+
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ private AddOrganizationUuidToGroupRoles underTest = new AddOrganizationUuidToGroupRoles(dbTester.database());
+
+ @Test
+ public void creates_table_on_empty_db() throws SQLException {
+ underTest.execute();
+
+ dbTester.assertColumnDefinition("group_roles", "organization_uuid", Types.VARCHAR, 40, true);
+ }
+
+ @Test
+ public void migration_is_not_reentrant() throws SQLException {
+ underTest.execute();
+
+ expectedException.expect(IllegalStateException.class);
+
+ underTest.execute();
+ }
+
+}
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml
index 427afd01efd..3ff92c4b3a6 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml
@@ -4,7 +4,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<!-- Ghost project -->
<projects id="42"
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml
index a1c205bbb27..e4c48f2d86b 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml
@@ -4,7 +4,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<!-- Provisioned project -->
<projects id="42"
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml
index c7f37d3945a..8b350036658 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml
@@ -4,7 +4,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<!-- root project -->
diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml
index 0acfb905548..326a07d321d 100644
--- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml
@@ -4,7 +4,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<!-- root project -->
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml
index fccde239a00..b0c1649526e 100644
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/shared.xml
@@ -3,7 +3,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="399"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects uuid="ABCD"
uuid_path="NOT_USED"
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml
index 58cad579bdc..aea9404df06 100644
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/issue/IssueStatsDaoTest/should_select_assignees.xml
@@ -1,7 +1,15 @@
<dataset>
- <group_roles id="1" group_id="[null]" resource_id="399" role="user"/>
- <projects id="399" kee="my.project:kee" root_id="[null]" qualifier="TRK" scope="PRJ"/>
+ <group_roles id="1"
+ group_id="[null]"
+ resource_id="399"
+ role="user"
+ organization_uuid="[null]"/>
+ <projects id="399"
+ kee="my.project:kee"
+ root_id="[null]"
+ qualifier="TRK"
+ scope="PRJ"/>
<issues
id="100"
@@ -27,7 +35,7 @@
created_at="2013-04-16"
updated_at="2013-04-16"
locations="[null]"
- />
+ />
<issues
id="101"
@@ -53,7 +61,7 @@
created_at="2013-04-16"
updated_at="2013-04-16"
locations="[null]"
- />
+ />
<issues
id="102"
@@ -79,5 +87,5 @@
created_at="2013-04-16"
updated_at="2013-04-16"
locations="[null]"
- />
+ />
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/anonymous_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/anonymous_should_be_authorized.xml
index 82ffcce1b25..83167bd9f8e 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/anonymous_should_be_authorized.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/anonymous_should_be_authorized.xml
@@ -10,11 +10,13 @@
<group_roles id="1"
group_id="[null]"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="[null]"
resource_id="400"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="301"
kee="pj-w-snapshot:package"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/group_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/group_should_be_authorized.xml
index 5b3b2431da4..9984fe2564a 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/group_should_be_authorized.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/group_should_be_authorized.xml
@@ -12,11 +12,13 @@
<group_roles id="1"
group_id="200"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="200"
resource_id="400"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="301"
kee="pj-w-snapshot:package"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/is_authorized_component_key_for_global_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/is_authorized_component_key_for_global_permission.xml
index 749bd6e5ba1..84872fe06db 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/is_authorized_component_key_for_global_permission.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/is_authorized_component_key_for_global_permission.xml
@@ -12,7 +12,8 @@
<group_roles id="1"
group_id="200"
resource_id="[null]"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="301"
kee="pj-w-snapshot:package"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_anonymous.xml
index 19724d2ab2d..a94ea95f0cc 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_anonymous.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_anonymous.xml
@@ -5,11 +5,13 @@
<group_roles id="1"
group_id="[null]"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="200"
resource_id="400"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_group.xml
index 4ca03a05ac3..3cdc77d77f4 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_group.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_project_ids_for_group.xml
@@ -5,11 +5,13 @@
<group_roles id="1"
group_id="200"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="200"
resource_id="400"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml
index edbc14d2a57..3b6f39ed7ed 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_anonymous.xml
@@ -27,11 +27,13 @@
<group_roles id="1"
group_id="[null]"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="201"
resource_id="400"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_group.xml
index 0c6ecc21c52..373dfd2cc40 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_group.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_group.xml
@@ -27,11 +27,13 @@
<group_roles id="1"
group_id="200"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="201"
resource_id="400"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_user.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_user.xml
index e24046e8ea2..51e54fa5edf 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_user.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/keep_authorized_users_for_role_and_project_for_user.xml
@@ -27,7 +27,8 @@
<group_roles id="1"
group_id="200"
resource_id="400"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_anonymous.xml
index 69d6d1deac1..bd1d5067213 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_anonymous.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_anonymous.xml
@@ -14,10 +14,12 @@
<group_roles id="200"
group_id="[null]"
resource_id="[null]"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="201"
group_id="[null]"
resource_id="[null]"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_group_anyone.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_group_anyone.xml
index 8cf3146b93f..eb69e877be7 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_group_anyone.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_global_permissions_for_group_anyone.xml
@@ -16,6 +16,7 @@
<group_roles id="1"
group_id="[null]"
resource_id="[null]"
- role="profileadmin"/>
+ role="profileadmin"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_group_global_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_group_global_permissions.xml
index d2b43c25d1f..d051f0792c8 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_group_global_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_group_global_permissions.xml
@@ -30,10 +30,12 @@
<group_roles id="1"
group_id="200"
resource_id="[null]"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="201"
resource_id="[null]"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_anonymous.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_anonymous.xml
index 7349539dd9e..b17c218fcae 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_anonymous.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_anonymous.xml
@@ -10,7 +10,8 @@
<group_roles id="1"
group_id="[null]"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
uuid="ABCD"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_group.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_group.xml
index feedb08c4af..948fe093644 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_group.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_group.xml
@@ -12,7 +12,8 @@
<group_roles id="1"
group_id="200"
resource_id="300"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
uuid="ABCD"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_user.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_user.xml
index 66b1d888164..c7c72ba443a 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_user.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_root_project_keys_for_user.xml
@@ -11,7 +11,8 @@
<group_roles id="1"
group_id="200"
resource_id="999"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
uuid="ABCD"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_user_global_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_user_global_permissions.xml
index b0b48640e4a..da3d199d0d7 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_user_global_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/should_return_user_global_permissions.xml
@@ -33,10 +33,12 @@
<group_roles id="200"
group_id="200"
resource_id="[null]"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="201"
group_id="200"
resource_id="[null]"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/user_should_be_authorized.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/user_should_be_authorized.xml
index 1c5b0291972..4e3daa12fa8 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/user_should_be_authorized.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionDaoTest/user_should_be_authorized.xml
@@ -16,7 +16,8 @@
<group_roles id="1"
group_id="200"
resource_id="999"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects id="300"
kee="pj-w-snapshot"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template-result.xml
index e0fbea1348a..aa7cbaafb48 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template-result.xml
@@ -24,11 +24,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
@@ -39,27 +41,33 @@
<group_roles id="3"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="[null]"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="101"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="[null]"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="8"
group_id="100"
resource_id="123"
- role="issueadmin"/>
+ role="issueadmin"
+ organization_uuid="[null]"/>
<!-- new user permission : marius (admin) & janette (user) -->
<user_roles id="2"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml
index 2d06c000c5f..1ea13a7e18c 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template.xml
@@ -41,11 +41,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id-result.xml
index dd703dcaf7c..b9419ff2a12 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id-result.xml
@@ -24,11 +24,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
@@ -39,27 +41,33 @@
<group_roles id="3"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="[null]"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="101"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="[null]"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="8"
group_id="100"
resource_id="123"
- role="issueadmin"/>
+ role="issueadmin"
+ organization_uuid="[null]"/>
<!-- new user permission : marius (admin) & janette (user) -->
<user_roles id="2"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id.xml
index f6766db51cc..72b76d08168 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/apply_default_permission_template_by_component_id.xml
@@ -34,11 +34,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template-result.xml
index b2acc6341e2..f47ba76efb4 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template-result.xml
@@ -18,11 +18,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
@@ -33,27 +35,33 @@
<group_roles id="3"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="[null]"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="101"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="[null]"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<group_roles id="8"
group_id="100"
resource_id="123"
- role="issueadmin"/>
+ role="issueadmin"
+ organization_uuid="[null]"/>
<!-- new user permission : marius (admin) -->
<user_roles id="2"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml
index 02d96a19072..f908cfe1a43 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_apply_permission_template.xml
@@ -35,11 +35,13 @@
<group_roles id="1"
group_id="100"
resource_id="1"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="101"
resource_id="1"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="1"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_count_component_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_count_component_permissions.xml
index 8afe021f56a..f01b60ff250 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_count_component_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_count_component_permissions.xml
@@ -20,6 +20,7 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml
index 6411c7d4832..20cae681be4 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission-result.xml
@@ -7,7 +7,8 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<projects uuid="A"
uuid_path="NOT_USED"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml
index 003db1cfaa5..4c136d3824f 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_delete_group_permission.xml
@@ -7,11 +7,13 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="100"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<projects uuid="A"
uuid_path="NOT_USED"
diff --git a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_remove_all_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_remove_all_permissions.xml
index 8afe021f56a..f01b60ff250 100644
--- a/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_remove_all_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/permission/PermissionRepositoryTest/should_remove_all_permissions.xml
@@ -20,6 +20,7 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
</dataset>
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 5ec76d7b86c..392f09afa38 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
@@ -10,20 +10,24 @@
<group_roles id="4"
group_id="101"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="[null]"
role="scan"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="[null]"
role="provisioning"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="102"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
</dataset>
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 ee0f3dc5b04..6c618d418c7 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,33 +11,40 @@
<group_roles id="1"
group_id="100"
role="admin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="100"
role="profileadmin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<group_roles id="3"
group_id="100"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="[null]"
role="scan"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="[null]"
role="provisioning"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="102"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
</dataset>
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 dd1ee7a39da..f05583c7d9c 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
@@ -10,29 +10,35 @@
<group_roles id="1"
group_id="100"
role="admin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="3"
group_id="100"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<!-- Group 'anyone' has a NULL group_id -->
<group_roles id="5"
group_id="[null]"
role="scan"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="[null]"
role="provisioning"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="7"
group_id="102"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
</dataset>
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 5732d882cc1..ae90bef3c91 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,34 +10,41 @@
<group_roles id="1"
group_id="100"
role="admin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="100"
role="profileadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="3"
group_id="100"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="4"
group_id="101"
role="gateadmin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<!-- Group 'anyone' has a NULL group_id -->
<group_roles id="5"
group_id="[null]"
role="scan"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<group_roles id="6"
group_id="[null]"
role="provisioning"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
<!-- Component permission, it should not be returned with global permissions -->
<group_roles id="7"
group_id="102"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions-result.xml
index b5bae90e8e7..3a6f3a75c31 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions-result.xml
@@ -10,21 +10,25 @@
<group_roles id="1"
group_id="100"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<group_roles id="3"
group_id="101"
role="codeviewer"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<!-- Group 'anyone' has a NULL group_id -->
<group_roles id="4"
group_id="[null]"
role="user"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<group_roles id="5"
group_id="100"
role="admin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions.xml
index 382c0ef8cda..7d9adcbab16 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/resourceGroupPermissions.xml
@@ -10,26 +10,31 @@
<group_roles id="1"
group_id="100"
role="admin"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="100"
role="codeviewer"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<group_roles id="3"
group_id="101"
role="codeviewer"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<!-- Group 'anyone' has a NULL group_id -->
<group_roles id="4"
group_id="[null]"
role="user"
- resource_id="1"/>
+ resource_id="1"
+ organization_uuid="[null]"/>
<!-- Global permission, it should not be returned with component permissions -->
<group_roles id="5"
group_id="100"
role="admin"
- resource_id="[null]"/>
+ resource_id="[null]"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_count_component_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_count_component_permissions.xml
index 8afe021f56a..f01b60ff250 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_count_component_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_count_component_permissions.xml
@@ -20,6 +20,7 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_remove_all_permissions.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_remove_all_permissions.xml
index 8afe021f56a..f01b60ff250 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_remove_all_permissions.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleDaoTest/should_remove_all_permissions.xml
@@ -20,6 +20,7 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/countRoles.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/countRoles.xml
index e635f834a44..22e52a04da3 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/countRoles.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/countRoles.xml
@@ -15,11 +15,13 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="[null]"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="123"
@@ -30,7 +32,8 @@
<group_roles id="3"
group_id="101"
resource_id="999"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<user_roles id="2"
user_id="200"
resource_id="999"
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId-result.xml
index 682128d2fb1..827cbf47982 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId-result.xml
@@ -20,7 +20,8 @@
<group_roles id="3"
group_id="101"
resource_id="999"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<user_roles id="2"
user_id="200"
resource_id="999"
diff --git a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId.xml b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId.xml
index e635f834a44..22e52a04da3 100644
--- a/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/user/RoleMapperTest/deleteRolesByResourceId.xml
@@ -15,11 +15,13 @@
<group_roles id="1"
group_id="100"
resource_id="123"
- role="admin"/>
+ role="admin"
+ organization_uuid="[null]"/>
<group_roles id="2"
group_id="[null]"
resource_id="123"
- role="user"/>
+ role="user"
+ organization_uuid="[null]"/>
<user_roles id="1"
user_id="200"
resource_id="123"
@@ -30,7 +32,8 @@
<group_roles id="3"
group_id="101"
resource_id="999"
- role="codeviewer"/>
+ role="codeviewer"
+ organization_uuid="[null]"/>
<user_roles id="2"
user_id="200"
resource_id="999"
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest/previous-group_roles.sql b/sonar-db/src/test/resources/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest/previous-group_roles.sql
new file mode 100644
index 00000000000..a711f616070
--- /dev/null
+++ b/sonar-db/src/test/resources/org/sonar/db/version/v62/AddOrganizationUuidToGroupRolesTest/previous-group_roles.sql
@@ -0,0 +1,6 @@
+CREATE TABLE "GROUP_ROLES" (
+ "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "GROUP_ID" INTEGER,
+ "RESOURCE_ID" INTEGER,
+ "ROLE" VARCHAR(64) NOT NULL
+);