aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-auth
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2020-10-12 17:00:17 +0200
committersonartech <sonartech@sonarsource.com>2020-10-16 20:07:40 +0000
commit276abb42335b4609f922bbf7c289cc26bb98f302 (patch)
tree50c28ecea569e70ef44a1453a8ed71183ad0cbf9 /server/sonar-webserver-auth
parent073c87437febccfa5217eb42a86a31e646275b57 (diff)
downloadsonarqube-276abb42335b4609f922bbf7c289cc26bb98f302.tar.gz
sonarqube-276abb42335b4609f922bbf7c289cc26bb98f302.zip
SONAR-13936 Remove use of organizations in Permissions WS and DB
* SONAR-13936 Remove organization parameters from permissions WS * SONAR-13936 Remove organization_uuid column from user_roles table * SONAR-13936 Fix developer ITs * SONAR-13936 Remove organization_uuid column from group_roles table * SONAR-13936 Remove organization_uuid column from permission_templates table
Diffstat (limited to 'server/sonar-webserver-auth')
-rw-r--r--server/sonar-webserver-auth/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java3
-rw-r--r--server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionService.java2
-rw-r--r--server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionServiceImpl.java2
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/PermissionServiceImplTest.java2
4 files changed, 4 insertions, 5 deletions
diff --git a/server/sonar-webserver-auth/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java b/server/sonar-webserver-auth/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java
index 8284ab6f4d1..5277ae59103 100644
--- a/server/sonar-webserver-auth/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java
+++ b/server/sonar-webserver-auth/src/main/java/org/sonar/server/organization/OrganizationUpdaterImpl.java
@@ -164,7 +164,6 @@ public class OrganizationUpdaterImpl implements OrganizationUpdater {
new PermissionTemplateDto()
.setUuid(uuidFactory.create())
.setName(PERM_TEMPLATE_NAME)
- .setOrganizationUuid(organizationDto.getUuid())
.setDescription(format(PERM_TEMPLATE_DESCRIPTION_PATTERN, organizationDto.getName()))
.setCreatedAt(now)
.setUpdatedAt(now));
@@ -221,7 +220,7 @@ public class OrganizationUpdaterImpl implements OrganizationUpdater {
.setUuid(uuidFactory.create())
.setName(OWNERS_GROUP_NAME)
.setDescription(OWNERS_GROUP_DESCRIPTION));
- permissionService.getAllOrganizationPermissions().forEach(p -> addPermissionToGroup(dbSession, group, p));
+ permissionService.getGlobalPermissions().forEach(p -> addPermissionToGroup(dbSession, group, p));
return group;
}
diff --git a/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionService.java b/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionService.java
index 75175dc4920..93b5f65a82c 100644
--- a/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionService.java
+++ b/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionService.java
@@ -24,7 +24,7 @@ import org.sonar.db.permission.OrganizationPermission;
public interface PermissionService {
- List<OrganizationPermission> getAllOrganizationPermissions();
+ List<OrganizationPermission> getGlobalPermissions();
List<String> getAllProjectPermissions();
}
diff --git a/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionServiceImpl.java b/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionServiceImpl.java
index 9e621091595..9f5b72da99b 100644
--- a/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionServiceImpl.java
+++ b/server/sonar-webserver-auth/src/main/java/org/sonar/server/permission/PermissionServiceImpl.java
@@ -55,7 +55,7 @@ public class PermissionServiceImpl implements PermissionService {
* Return an immutable Set of all organization permissions
*/
@Override
- public List<OrganizationPermission> getAllOrganizationPermissions() {
+ public List<OrganizationPermission> getGlobalPermissions() {
return globalPermissions;
}
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/PermissionServiceImplTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/PermissionServiceImplTest.java
index e014b8b687d..44e92ab0051 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/PermissionServiceImplTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/permission/PermissionServiceImplTest.java
@@ -32,7 +32,7 @@ public class PermissionServiceImplTest {
@Test
public void organizationPermissions_must_be_ordered() {
- assertThat(underTest.getAllOrganizationPermissions())
+ assertThat(underTest.getGlobalPermissions())
.extracting(OrganizationPermission::getKey)
.containsExactly("admin", "gateadmin", "profileadmin", "provisioning", "scan", "applicationcreator", "portfoliocreator");
}