]> source.dussan.org Git - redmine.git/commitdiff
Merged r11605 from trunk (#13301).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Mar 2013 17:09:28 +0000 (17:09 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 12 Mar 2013 17:09:28 +0000 (17:09 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11606 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index 2bfbbd14e8d159cdcb211a6a6262ed9eb5205c38..bb74308efea01d85a03ee6259be38844ee7bf492 100644 (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