summaryrefslogtreecommitdiffstats
path: root/app/controllers/queries_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-05-10 10:54:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-05-10 10:54:31 +0000
commit7dccf9fda6f30d8f4b0c5eaad9f6e2a1e67cd643 (patch)
treeba6a18abff6ca69af528b3d295263d049a22266f /app/controllers/queries_controller.rb
parent814e138c2a1105f8d9d10c4362a889dd71aff32d (diff)
downloadredmine-7dccf9fda6f30d8f4b0c5eaad9f6e2a1e67cd643.tar.gz
redmine-7dccf9fda6f30d8f4b0c5eaad9f6e2a1e67cd643.zip
Allows multiple roles on the same project (#706). Prerequisite for user groups feature.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2726 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r--app/controllers/queries_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index b688d2c43..16755a125 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -24,7 +24,7 @@ class QueriesController < ApplicationController
@query = Query.new(params[:query])
@query.project = params[:query_is_for_all] ? nil : @project
@query.user = User.current
- @query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
+ @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.column_names = nil if params[:default_columns]
params[:fields].each do |field|
@@ -48,7 +48,7 @@ class QueriesController < ApplicationController
end if params[:fields]
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
- @query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
+ @query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.column_names = nil if params[:default_columns]
if @query.save