summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/pipelines.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb
index d4bd4e71343..39d693bb9e9 100644
--- a/lib/api/pipelines.rb
+++ b/lib/api/pipelines.rb
@@ -89,11 +89,11 @@ module API
requires :pipeline_id, type: Integer, desc: 'The pipeline ID'
end
delete ':id/pipelines/:pipeline_id' do
- authorize! :admin_pipeline, user_project
+ authorize! :destroy_pipeline, user_project
- AuditEventService.new(current_user, user_project).security_event
-
- destroy_conditionally!(pipeline)
+ destroy_conditionally!(pipeline) do
+ ::Ci::DestroyPipelineService.new(user_project, current_user).execute(pipeline)
+ end
end
desc 'Retry builds in the pipeline' do