summaryrefslogtreecommitdiffstats
path: root/app/controllers/queries_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r--app/controllers/queries_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 10051ab02..348806198 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -126,7 +126,7 @@ class QueriesController < ApplicationController
@query.column_names = nil if params[:default_columns]
@query.sort_criteria = (params[:query] && params[:query][:sort_criteria]) || @query.sort_criteria
@query.name = params[:query] && params[:query][:name]
- if User.current.allowed_to?(:manage_public_queries, @query.project) || User.current.admin?
+ if User.current.allowed_to?(:manage_public_queries, @query.project) || User.current.admin? || (@query.type == 'ProjectQuery' && User.current.allowed_to?(:manage_public_queries, @query.project, :global => true))
@query.visibility = (params[:query] && params[:query][:visibility]) || Query::VISIBILITY_PRIVATE
@query.role_ids = params[:query] && params[:query][:role_ids]
else
@@ -156,6 +156,10 @@ class QueriesController < ApplicationController
redirect_to _time_entries_path(@project, nil, options)
end
+ def redirect_to_project_query(options)
+ redirect_to projects_path(options)
+ end
+
# Returns the Query subclass, IssueQuery by default
# for compatibility with previous behaviour
def query_class