diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 11:36:13 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2019-10-19 11:36:13 +0000 |
commit | 6c5440a21b491982c02531c82b4416ef212eb3dc (patch) | |
tree | 27d069aac9d26f8f6b76b697e8033b18fa65eaa3 /app/controllers/queries_controller.rb | |
parent | 868578c0f297875eeac324af8a8c7f1445593ecd (diff) | |
download | redmine-6c5440a21b491982c02531c82b4416ef212eb3dc.tar.gz redmine-6c5440a21b491982c02531c82b4416ef212eb3dc.zip |
Filters for Projects page (#29482).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@18761 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r-- | app/controllers/queries_controller.rb | 6 |
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 |