From: Teryk Bellahsene Date: Tue, 15 Nov 2016 14:20:54 +0000 (+0100) Subject: Project admin permission is not considered as a System Admin X-Git-Tag: 6.2-RC1~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8c933019b0404716488e8c919c2b7571a425e9ee;p=sonarqube.git Project admin permission is not considered as a System Admin --- diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ServerUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ServerUserSessionTest.java index 91f5b85adb8..a26e65bb4ea 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ServerUserSessionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ServerUserSessionTest.java @@ -336,7 +336,9 @@ public class ServerUserSessionTest { @Test public void hasOrganizationPermission_for_logged_in_user() { OrganizationDto org = db.organizations().insert(); + ComponentDto project = db.components().insertProject(); db.users().insertPermissionOnUser(org, userDto, GlobalPermissions.PROVISIONING); + db.users().insertProjectPermissionOnUser(org, userDto, UserRole.ADMIN, project); UserSession session = newUserSession(userDto); assertThat(session.hasOrganizationPermission(org.getUuid(), GlobalPermissions.PROVISIONING)).isTrue(); diff --git a/sonar-db/src/main/resources/org/sonar/db/permission/AuthorizationMapper.xml b/sonar-db/src/main/resources/org/sonar/db/permission/AuthorizationMapper.xml index 6c132aeb434..d5e441bcbce 100644 --- a/sonar-db/src/main/resources/org/sonar/db/permission/AuthorizationMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/permission/AuthorizationMapper.xml @@ -28,6 +28,7 @@ where ur.organization_uuid=#{organizationUuid,jdbcType=VARCHAR} and ur.user_id=#{userId,jdbcType=BIGINT} + and ur.resource_id is null