summaryrefslogtreecommitdiff
path: root/app/finders/releases_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/releases_finder.rb')
-rw-r--r--app/finders/releases_finder.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/finders/releases_finder.rb b/app/finders/releases_finder.rb
index 0cfa4310ab7..0d72d6ffc6b 100644
--- a/app/finders/releases_finder.rb
+++ b/app/finders/releases_finder.rb
@@ -38,19 +38,17 @@ class ReleasesFinder
if parent.is_a?(Project)
Ability.allowed?(current_user, :read_release, parent) ? [parent] : []
elsif parent.is_a?(Group)
- accessible_projects
+ Ability.allowed?(current_user, :read_release, parent) ? accessible_projects : []
end
end
end
def accessible_projects
- projects = if include_subgroups?
- Project.for_group_and_its_subgroups(parent)
- else
- parent.projects
- end
-
- projects.select { |project| Ability.allowed?(current_user, :read_release, project) }
+ if include_subgroups?
+ Project.for_group_and_its_subgroups(parent)
+ else
+ parent.projects
+ end
end
# rubocop: disable CodeReuse/ActiveRecord