Sync with trunk r1778.

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1779 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-08-31 16:45:46 +00:00
parent ef83abe725
commit 068448d734
43 changed files with 161 additions and 24 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ class User < ActiveRecord::Base
elsif options[:global]
# authorize if user has at least one role that has this permission
roles = memberships.collect {|m| m.role}.uniq
roles.detect {|r| r.allowed_to?(action)}
roles.detect {|r| r.allowed_to?(action)} || (self.logged? ? Role.non_member.allowed_to?(action) : Role.anonymous.allowed_to?(action))
else
false
end