From: Simon Brandhof Date: Thu, 2 Feb 2017 10:50:56 +0000 (+0100) Subject: SONAR-8716 fix support of orgs in PermissionTemplateService X-Git-Tag: 6.3-RC1~170 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1a5d9053b02ad174c7aebcdb99bd7e4cea7ebd0b;p=sonarqube.git SONAR-8716 fix support of orgs in PermissionTemplateService --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java b/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java index 398c6c3486b..1465bd49326 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java @@ -70,9 +70,9 @@ public class PermissionTemplateService { } public boolean wouldUserHavePermissionWithDefaultTemplate(DbSession dbSession, - String organizationUuid, @Nullable Long userId, String permission, @Nullable String branch, String projectKey, + String organizationUuid, @Nullable Long userId, String globalPermission, @Nullable String branch, String projectKey, String qualifier) { - if (userSession.hasPermission(permission)) { + if (userSession.hasOrganizationPermission(organizationUuid, globalPermission)) { return true; } @@ -83,7 +83,7 @@ public class PermissionTemplateService { } List potentialPermissions = dbClient.permissionTemplateDao().selectPotentialPermissionsByUserIdAndTemplateId(dbSession, userId, template.getId()); - return potentialPermissions.contains(permission); + return potentialPermissions.contains(globalPermission); } /**