summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-11 17:45:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-11 17:45:10 +0000
commit888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b (patch)
tree17bb48e3b640635b2fa62b85e2b10ccaf5b4f65c /app/controllers
parent4545b906b4c58e2bd1d201fd18a49249aa571dfc (diff)
downloadredmine-888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b.tar.gz
redmine-888c3581eb0fbfc5ede87a24f7f03bfa4f7d810b.zip
Role based custom queries (#1019).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11994 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/queries_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 639255125..cd1ec87a2 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -45,7 +45,7 @@ class QueriesController < ApplicationController
@query = IssueQuery.new
@query.user = User.current
@query.project = @project
- @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
+ @query.visibility = IssueQuery::VISIBILITY_PRIVATE unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.build_from_params(params)
end
@@ -53,7 +53,7 @@ class QueriesController < ApplicationController
@query = IssueQuery.new(params[:query])
@query.user = User.current
@query.project = params[:query_is_for_all] ? nil : @project
- @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
+ @query.visibility = IssueQuery::VISIBILITY_PRIVATE unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.build_from_params(params)
@query.column_names = nil if params[:default_columns]
@@ -71,7 +71,7 @@ class QueriesController < ApplicationController
def update
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
- @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
+ @query.visibility = IssueQuery::VISIBILITY_PRIVATE unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.build_from_params(params)
@query.column_names = nil if params[:default_columns]