diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-30 14:20:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-30 14:20:07 +0000 |
commit | da641f4122f7034b87a67e87386104fb5d121166 (patch) | |
tree | 30b8b5d477a493af032a76ece3b0533c03eed6c1 /app/controllers/queries_controller.rb | |
parent | 287d86e3632546b06aeb955db8b0e5eea139082b (diff) | |
download | redmine-da641f4122f7034b87a67e87386104fb5d121166.tar.gz redmine-da641f4122f7034b87a67e87386104fb5d121166.zip |
Global queries can be saved from the global issue list (follows r1311 and closes #897).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1312 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r-- | app/controllers/queries_controller.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index 194b1df57..da2c4a2c8 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -19,7 +19,7 @@ class QueriesController < ApplicationController layout 'base' menu_item :issues before_filter :find_query, :except => :new - before_filter :find_project, :authorize, :only => :new + before_filter :find_optional_project, :only => :new def new @query = Query.new(params[:query]) @@ -72,8 +72,9 @@ private render_404 end - def find_project - @project = Project.find(params[:project_id]) + def find_optional_project + @project = Project.find(params[:project_id]) if params[:project_id] + User.current.allowed_to?(:save_queries, @project, :global => true) rescue ActiveRecord::RecordNotFound render_404 end |