@@ -118,7 +118,7 class Project < ActiveRecord::Base | |||||
118 | elsif user.logged? |
|
118 | elsif user.logged? | |
119 | statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission) |
|
119 | statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission) | |
120 | allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id} |
|
120 | allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id} | |
121 | statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" |
|
121 | statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any? | |
122 | else |
|
122 | else | |
123 | statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.anonymous.allowed_to?(permission) |
|
123 | statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.anonymous.allowed_to?(permission) | |
124 | end |
|
124 | end |
General Comments 0
You need to be logged in to leave comments.
Login now