]> source.dussan.org Git - redmine.git/commitdiff
Fixed #759: Can not view a project without View time entries permission (broken by...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 1 Mar 2008 20:09:57 +0000 (20:09 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 1 Mar 2008 20:09:57 +0000 (20:09 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1184 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb

index 8f1dada1d9dd8049fb78bab3b8a7900c60f9d74a..95a201454c7344a49d7cf7bca381eabf82c3b065 100644 (file)
@@ -118,7 +118,7 @@ class Project < ActiveRecord::Base
     elsif user.logged?
       statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
       allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
-      statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})"
+      statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
     else
       statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.anonymous.allowed_to?(permission)
     end