Commit 468c9ce4648462dee9eaf9001d23b925386a4531
1 parent
9e181d36
Exists in
spb-stable
and in
3 other branches
Allow issues to be viewed for authenticated user when project is public or internal.
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
app/services/filtering_service.rb
@@ -45,7 +45,11 @@ class FilteringService | @@ -45,7 +45,11 @@ class FilteringService | ||
45 | current_user.send(table_name) | 45 | current_user.send(table_name) |
46 | when 'all' then | 46 | when 'all' then |
47 | if current_user | 47 | if current_user |
48 | - klass.of_projects(current_user.authorized_projects.pluck(:id)) | 48 | + if project && (project.public? || project.internal?) |
49 | + klass.of_projects(Project.public_or_internal_only(current_user)) | ||
50 | + else | ||
51 | + klass.of_projects(current_user.authorized_projects.pluck(:id)) | ||
52 | + end | ||
49 | else | 53 | else |
50 | klass.of_projects(Project.public_only) | 54 | klass.of_projects(Project.public_only) |
51 | end | 55 | end |
@@ -120,4 +124,8 @@ class FilteringService | @@ -120,4 +124,8 @@ class FilteringService | ||
120 | 124 | ||
121 | items | 125 | items |
122 | end | 126 | end |
127 | + | ||
128 | + def project | ||
129 | + Project.where(id: params[:project_id]).first if params[:project_id].present? | ||
130 | + end | ||
123 | end | 131 | end |