diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-09-29 09:33:59 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-09-29 09:34:05 +0200 |
commit | 1b4952702e316695cef84cc7556f073fd469f4d0 (patch) | |
tree | 602225fea74f9e1418b616130ca1bf347b07fad4 /sonar-db | |
parent | 211911d6ca8f772c9a9a3efa4feda103eb4b5b09 (diff) | |
download | sonarqube-1b4952702e316695cef84cc7556f073fd469f4d0.tar.gz sonarqube-1b4952702e316695cef84cc7556f073fd469f4d0.zip |
SONAR-6854 WS permissions/template_groups fix queries for Oracle
Diffstat (limited to 'sonar-db')
-rw-r--r-- | sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml | 9 | ||||
-rw-r--r-- | sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml b/sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml index ca220bbbfb4..f173f86eb24 100644 --- a/sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml @@ -117,6 +117,7 @@ AND ptg.template_id=#{templateId} AND ptg.group_id IS NULL </where>) as permission + FROM groups g ) groups <where> <if test="query.search() != null"> @@ -143,13 +144,17 @@ AND ptg.template_id=#{templateId} UNION -- Add Anyone group permission - SELECT #{anyoneGroup} as name, NULL as description, ptg.permission_reference as permission + SELECT + #{anyoneGroup} as name, + NULL as description, + (select ptg.permission_reference FROM perm_templates_groups ptg <where> AND ptg.permission_reference=#{query.permission} AND ptg.template_id=#{templateId} AND ptg.group_id IS NULL - </where> + </where>) as permission + FROM groups g ) groups <where> <if test="groupName!=null"> diff --git a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java index 90bc61b3408..0370a002ced 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java @@ -75,7 +75,7 @@ public class GroupWithPermissionTemplateDaoTest { } @Test - public void anyone_group_is_not_returned_when_it_has_no_permission() { + public void anyone_group_is_returned_when_it_has_no_permission() { dbTester.prepareDbUnit(getClass(), "groups_with_permissions.xml"); // Anyone group is returned even if it doesn't have the permission |