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:
authorWinnie Hellmann <winnie@gitlab.com>2018-07-10 11:11:04 +0300
committerPhil Hughes <me@iamphill.com>2018-07-10 11:11:04 +0300
commitd79cef3a9a5577765d975326fbf4bc1b8c5634de (patch)
treefad8dce6f89102fda75f511dee80b7fae7675994 /lib/api/environments.rb
parentca1deb9e5ec1429a65d73b3352d1207301f9fc6f (diff)
Support manually stopping any environment from the UI
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 5c63ec028d9..fa828f43001 100644
--- a/lib/api/environments.rb
+++ b/lib/api/environments.rb
@@ -89,9 +89,10 @@ module API
requires :environment_id, type: Integer, desc: 'The environment ID'
end
post ':id/environments/:environment_id/stop' do
- authorize! :create_deployment, user_project
+ authorize! :read_environment, user_project
environment = user_project.environments.find(params[:environment_id])
+ authorize! :stop_environment, environment
environment.stop_with_action!(current_user)