summaryrefslogtreecommitdiff
path: root/app/finders/environments/environment_names_finder.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-29 23:47:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-29 23:47:44 +0000
commit297ad29837559abc899e81626ab9deeab11c1c2c (patch)
tree2c20b00a02c5f98d6ff7f38eb3664e3d848f5e93 /app/finders/environments/environment_names_finder.rb
parentc00b0b2dedd4748d8f2d44c70c954d39e37d4696 (diff)
downloadgitlab-ce-297ad29837559abc899e81626ab9deeab11c1c2c.tar.gz
Add latest changes from gitlab-org/security/gitlab@15-8-stable-ee
Diffstat (limited to 'app/finders/environments/environment_names_finder.rb')
-rw-r--r--app/finders/environments/environment_names_finder.rb11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/finders/environments/environment_names_finder.rb b/app/finders/environments/environment_names_finder.rb
index d4928f0fc84..ffb689f45e2 100644
--- a/app/finders/environments/environment_names_finder.rb
+++ b/app/finders/environments/environment_names_finder.rb
@@ -32,18 +32,9 @@ module Environments
end
def namespace_environments
- # We assume reporter access is needed for the :read_environment permission
- # here. This expection is also present in
- # IssuableFinder::Params#min_access_level, which is used for filtering out
- # merge requests that don't have the right permissions.
- #
- # We use this approach so we don't need to load every project into memory
- # just to verify if we can see their environments. Doing so would not be
- # efficient, and possibly mess up pagination if certain projects are not
- # meant to be visible.
projects = project_or_group
.all_projects
- .public_or_visible_to_user(current_user, Gitlab::Access::REPORTER)
+ .filter_by_feature_visibility(:environments, current_user)
Environment.for_project(projects)
end