From 4855ea135e5685bb818985dc58603746d2fb8676 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 6 Dec 2012 17:09:17 +0100 Subject: [PATCH] SONAR-3825 system filters should be editable by administrators --- .../WEB-INF/app/controllers/measures_controller.rb | 10 +++------- .../main/webapp/WEB-INF/app/models/measure_filter.rb | 5 +++++ .../webapp/WEB-INF/app/views/measures/search.html.erb | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) 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 82c27224d29..6245780508d 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 @@ -111,7 +111,7 @@ class MeasuresController < ApplicationController require_parameters :id @filter = MeasureFilter.find(params[:id]) - access_denied unless owner?(@filter) + access_denied unless @filter.owner?(current_user) @filter.name=params[:name] @filter.description=params[:description] @filter.shared=(params[:shared]=='true') @@ -177,7 +177,7 @@ class MeasuresController < ApplicationController :conditions => ['user_id=? and measure_filter_id=?', current_user.id, params[:id]]) if favourites.empty? filter = find_filter(params[:id]) - current_user.favourited_measure_filters<
  • <%= message('copy') -%>
  • <% end %> - <% if @filter.id==nil || @filter.user_id==current_user.id %> + <% if @filter.owner?(current_user) %>
  • <%= message('save') -%>
  • <% end %> <% end %> -- 2.39.5