From 680f1e0dd4d2b72e7eac70920ba153a60c9cb006 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 26 Aug 2014 15:28:51 +0200 Subject: [PATCH] SONAR-4963 Return description in /permission_templates/search_groups --- .../controllers/permission_templates_controller.rb | 12 ++++++++---- .../core/permission/PermissionTemplateMapper.xml | 6 +++--- .../GroupWithPermissionTemplateDaoTest.java | 4 ++++ .../groups_with_permissions.xml | 6 +++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb index fc073ec0ddb..4babd23a90f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/permission_templates_controller.rb @@ -102,10 +102,14 @@ class PermissionTemplatesController < ApplicationController format.json { render :json => { :more => more, - :results => groups.map { |group| { - :name => group.name(), - :selected => group.hasPermission() - }} + :results => groups.map { |group| + hash = { + :name => group.name(), + :selected => group.hasPermission() + } + hash[:description] = group.description() if group.description() && !group.description().blank? + hash + } } } end diff --git a/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml b/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml index 2ec027daa89..64fb208e8e9 100644 --- a/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/permission/PermissionTemplateMapper.xml @@ -89,15 +89,15 @@