diff options
Diffstat (limited to 'sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml')
-rw-r--r-- | sonar-db/src/main/resources/org/sonar/db/permission/PermissionTemplateMapper.xml | 13 |
1 files changed, 11 insertions, 2 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 95567f2e5c2..5ca9eb2859f 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 @@ -68,6 +68,16 @@ <select id="selectUsers" parameterType="map" resultType="UserWithPermission"> SELECT u.login as login, u.name as name, ptu.permission_reference as permission + <include refid="usersSelection"/> + ORDER BY u.name + </select> + + <select id="countUsers" parameterType="map" resultType="int"> + SELECT count(u.login) + <include refid="usersSelection"/> + </select> + + <sql id="usersSelection"> FROM users u LEFT JOIN perm_templates_users ptu ON ptu.user_id=u.id AND ptu.permission_reference=#{query.permission} @@ -86,8 +96,7 @@ AND (UPPER(u.name) LIKE #{query.searchSql} ESCAPE '/') </if> </where> - ORDER BY u.name - </select> + </sql> <select id="selectGroups" parameterType="map" resultType="GroupWithPermission"> SELECT name, description, permission FROM |