aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/permission/AuthorizationMapper.xml1
-rw-r--r--sonar-db/src/test/java/org/sonar/db/permission/AuthorizationDaoTest.java2
2 files changed, 3 insertions, 0 deletions
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
</select>
<select id="selectOrganizationPermissionsOfAnonymous" parameterType="map" resultType="string">
diff --git a/sonar-db/src/test/java/org/sonar/db/permission/AuthorizationDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/AuthorizationDaoTest.java
index 9f213a99fbe..42adf47bd9a 100644
--- a/sonar-db/src/test/java/org/sonar/db/permission/AuthorizationDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/permission/AuthorizationDaoTest.java
@@ -72,8 +72,10 @@ public class AuthorizationDaoTest {
*/
@Test
public void selectOrganizationPermissions_for_logged_in_user() {
+ ComponentDto project = db.components().insertProject();
db.users().insertMember(group1, user);
db.users().insertPermissionOnUser(org, user, "perm1");
+ db.users().insertProjectPermissionOnUser(org, user, "perm42", project);
db.users().insertPermissionOnGroup(group1, "perm2");
db.users().insertPermissionOnAnyone(org, "perm3");