Commit 8ea2ecb9 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent 7ee55562
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment