Commit 8116e400 authored by Douwe Maan's avatar Douwe Maan

Don't skip authorization when stopping CI environments

parent 9d7c5e75
......@@ -5,7 +5,7 @@ class EnvironmentsFinder
@project, @current_user, @params = project, current_user, params
end
def execute(skip_authorization: false)
def execute
deployments = project.deployments
deployments =
if ref
......@@ -36,13 +36,9 @@ class EnvironmentsFinder
end
end
unless skip_authorization
environments.select! do |environment|
Ability.allowed?(current_user, :read_environment, environment)
end
environments.select do |environment|
Ability.allowed?(current_user, :read_environment, environment)
end
environments
end
private
......
......@@ -23,7 +23,7 @@ module Ci
def environments
@environments ||=
EnvironmentsFinder.new(project, nil, ref: @ref, recently_updated: true).execute(skip_authorization: true)
EnvironmentsFinder.new(project, current_user, ref: @ref, recently_updated: true).execute
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment