diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-12 17:09:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-03-12 17:09:28 +0000 |
commit | 94ecabbaf908a6366abf29aacfba88fc89a7d6d2 (patch) | |
tree | 376c3c8751a48aef2cf1eb83245ab316df7e8435 | |
parent | 063c9a2a83ddf121d48fed753e318e765daa8a3e (diff) | |
download | redmine-94ecabbaf908a6366abf29aacfba88fc89a7d6d2.tar.gz redmine-94ecabbaf908a6366abf29aacfba88fc89a7d6d2.zip |
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
-rw-r--r-- | app/models/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 2bfbbd14e..bb74308ef 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 |