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:
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb
index ec58b3b7bb9..e5db9cdedc8 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -82,9 +82,10 @@ module API
requires :environment_id, type: Integer, desc: 'The environment ID'
end
delete ':id/environments/:environment_id' do
- authorize! :update_environment, user_project
+ authorize! :read_environment, user_project
environment = user_project.environments.find(params[:environment_id])
+ authorize! :destroy_environment, environment
destroy_conditionally!(environment)
end