From: Jean-Baptiste Vilain Date: Wed, 24 Jul 2013 16:49:54 +0000 (+0200) Subject: SONAR-4453 Fixed issue with single view permissions update X-Git-Tag: 3.7~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8a84e2454ef5dc77c235cff31eac75e8cca0c7d6;p=sonarqube.git SONAR-4453 Fixed issue with single view permissions update --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb index 0ccae067312..b0466bce768 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/roles_controller.rb @@ -85,6 +85,7 @@ class RolesController < ApplicationController @keys = params[:keys] @qualifiers = params[:qualifiers] || 'TRK' @results_count = params[:results_count].to_i || 0 + @components = params[:components] render :partial => 'apply_template_form' end @@ -94,10 +95,12 @@ class RolesController < ApplicationController verify_post_request require_parameters :template_key - params['pageSize'] = -1 - components = Internal.component_api.find(params).components().to_a + if params['components'].blank? + params['pageSize'] = -1 + components = Internal.component_api.find(params).components().to_a + params['components'] = components.collect{|component| component.getId()}.join(',') + end - params['components'] = components.collect{|component| component.getId()}.join(',') Internal.permissions.applyPermissionTemplate(params) redirect_to :action => 'projects' diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb index 5062a63e056..f699b469808 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/_apply_template_form.html.erb @@ -3,6 +3,7 @@ + <% end %>