Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-30 02:48:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-30 02:48:05 +0300
commit3dd03a1a19e6b788ec1296044e28f7727e5149a6 (patch)
tree133f13a2c5bb0fbb7cc5706487b91134194b3870 /app/finders
parent096459e2c2c8e3c17eb6e677091990adffe9af7d (diff)
Add latest changes from gitlab-org/security/gitlab@15-10-stable-ee
Diffstat (limited to 'app/finders')
-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