From: Jean-Baptiste Vilain Date: Tue, 18 Jun 2013 08:01:41 +0000 (+0200) Subject: SONAR-4398 Added support for measure filter ownership changes by admin X-Git-Tag: 3.7~463 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=547d2b90da8be114a7c0c88dd5a1fde78af85cf5;p=sonarqube.git SONAR-4398 Added support for measure filter ownership changes by admin --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb index 4b3d1c05005..0d4887ec009 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb @@ -135,10 +135,11 @@ class MeasuresController < ApplicationController require_parameters :id @filter = MeasureFilter.find(params[:id]) - access_denied unless @filter.owner?(current_user) + access_denied unless has_role?(:admin) @filter.name=params[:name] @filter.description=params[:description] @filter.shared=(params[:shared]=='true') + @filter.user = User.find_by_login(params[:owner]) if @filter.save render :text => @filter.id.to_s, :status => 200 else diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb index ddce1fa28bc..0f146e17353 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_edit_form.html.erb @@ -16,6 +16,10 @@ +