diff options
author | Aurelien Poscia <aurelien.poscia@sonarsource.com> | 2023-07-10 11:15:56 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-07-18 20:03:21 +0000 |
commit | 4108de32c8e7850b90fecd87ccdcbbb71cdc464d (patch) | |
tree | 81a314dde1709956db1df1c6dfbde75fb10b2a5e /server/sonar-server-common | |
parent | f00fe6f03bf4eb7b0ae0e8b690174d73785c585f (diff) | |
download | sonarqube-4108de32c8e7850b90fecd87ccdcbbb71cdc464d.tar.gz sonarqube-4108de32c8e7850b90fecd87ccdcbbb71cdc464d.zip |
SONAR-19785 update SQ groups permissions from GitHub teams permissions
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r-- | server/sonar-server-common/src/main/java/org/sonar/server/project/VisibilityService.java | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/project/VisibilityService.java b/server/sonar-server-common/src/main/java/org/sonar/server/project/VisibilityService.java index d9e57b1672e..8768b1d5625 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/project/VisibilityService.java +++ b/server/sonar-server-common/src/main/java/org/sonar/server/project/VisibilityService.java @@ -51,13 +51,6 @@ public class VisibilityService { this.indexers = indexers; this.uuidFactory = uuidFactory; } - public void changeVisibility(String entityUuid, boolean isPrivate) { - try (DbSession dbSession = dbClient.openSession(false)) { - EntityDto entityDto = dbClient.entityDao().selectByUuid(dbSession, entityUuid) - .orElseThrow(() -> new IllegalStateException("Component must be a project, a portfolio or an application")); - changeVisibility(entityDto, isPrivate); - } - } public void changeVisibility(EntityDto entityDto, boolean isPrivate) { try (DbSession dbSession = dbClient.openSession(false)) { @@ -90,13 +83,13 @@ public class VisibilityService { if (entity.isProjectOrApp()) { dbClient.projectDao().updateVisibility(dbSession, entity.getUuid(), newIsPrivate); - dbClient.branchDao().selectByProjectUuid(dbSession, entity.getUuid()).stream() .filter(branch -> !branch.isMain()) .forEach(branch -> dbClient.componentDao().setPrivateForBranchUuidWithoutAuditLog(dbSession, branch.getUuid(), newIsPrivate)); } else { dbClient.portfolioDao().updateVisibilityByPortfolioUuid(dbSession, entity.getUuid(), newIsPrivate); } + entity.setPrivate(newIsPrivate); } private void updatePermissionsToPrivate(DbSession dbSession, EntityDto entity) { |