From 468c9ce4648462dee9eaf9001d23b925386a4531 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Fri, 31 Jan 2014 17:06:13 +0100 Subject: [PATCH] Allow issues to be viewed for authenticated user when project is public or internal. --- app/services/filtering_service.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/services/filtering_service.rb b/app/services/filtering_service.rb index b339065..76a3d71 100644 --- a/app/services/filtering_service.rb +++ b/app/services/filtering_service.rb @@ -45,7 +45,11 @@ class FilteringService current_user.send(table_name) when 'all' then if current_user - klass.of_projects(current_user.authorized_projects.pluck(:id)) + if project && (project.public? || project.internal?) + klass.of_projects(Project.public_or_internal_only(current_user)) + else + klass.of_projects(current_user.authorized_projects.pluck(:id)) + end else klass.of_projects(Project.public_only) end @@ -120,4 +124,8 @@ class FilteringService items end + + def project + Project.where(id: params[:project_id]).first if params[:project_id].present? + end end -- libgit2 0.21.2