Merged r11605 from trunk (#13301).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11606 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-03-12 17:09:28 +00:00
parent 063c9a2a83
commit 94ecabbaf9
1 changed files with 5 additions and 1 deletions

View File

@ -451,7 +451,7 @@ class User < Principal
# Return true if the user is a member of project
def member_of?(project)
roles_for_project(project).any? {|role| role.member?}
projects.to_a.include?(project)
end
# Returns a hash of user's projects grouped by roles
@ -692,6 +692,10 @@ class AnonymousUser < User
UserPreference.new(:user => self)
end
def member_of?(project)
false
end
# Anonymous user can not be destroyed
def destroy
false