]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5229 "Shared with all users" is not taken into account when copying a measure...
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 1 Aug 2014 07:44:49 +0000 (09:44 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 1 Aug 2014 07:44:57 +0000 (09:44 +0200)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb

index 7c955be664b49d56dda302b524a54e4bbae085a7..b7c210d08d18673b4164fade641e1f3ceb60eabd 100644 (file)
@@ -181,8 +181,7 @@ class MeasuresController < ApplicationController
     target.name=params[:name]
     target.description=params[:description]
     target.user_id=current_user.id
-    # Copy of filter should never be shared
-    target.shared=false
+    target.shared=(params[:shared]=='true') && has_role?(:shareDashboard)
     target.data=source.data
     if target.save
       current_user.favourited_measure_filters << target