Fixed: User#allowed_to? returning true in any case if array of projects had only one item (#5332)

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4233 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Baptiste Barth
2010-10-06 05:08:31 +00:00
parent e13790c62c
commit e59c927ee5
2 changed files with 8 additions and 2 deletions
+4 -2
View File
@@ -368,8 +368,10 @@ class User < Principal
elsif project && project.is_a?(Array)
# Authorize if user is authorized on every element of the array
project.inject do |memo,p|
memo && allowed_to?(action,p,options)
project.map do |p|
allowed_to?(action,p,options)
end.inject do |memo,p|
memo && p
end
elsif options[:global]
# Admin users are always authorized