From 1a5d9053b02ad174c7aebcdb99bd7e4cea7ebd0b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 2 Feb 2017 11:50:56 +0100 Subject: [PATCH] SONAR-8716 fix support of orgs in PermissionTemplateService --- .../sonar/server/permission/PermissionTemplateService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } /** -- 2.39.5