From: Jean-Philippe Lang Date: Sat, 1 Mar 2008 20:09:57 +0000 (+0000) Subject: Fixed #759: Can not view a project without View time entries permission (broken by... X-Git-Tag: 0.7.0-RC1~104 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8ea2ecb983c2a48c1a8ec5bb680f711829a91e0c;p=redmine.git Fixed #759: Can not view a project without View time entries permission (broken by r1176). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1184 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/project.rb b/app/models/project.rb index 8f1dada1d..95a201454 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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