summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-06 22:20:44 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-06 22:20:44 +0900
commit9b58b8e363fd388635385085c58be3d4637eaa45 (patch)
treee348f8d2cf9030d59448cea3dbc459a29bbecf95 /lib/api
parentd4ceec9d47a7da5fa17cb6e161ac491e13fcb8bd (diff)
downloadgitlab-ce-9b58b8e363fd388635385085c58be3d4637eaa45.tar.gz
Do not allow jobs to be erased
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/jobs.rb2
-rw-r--r--lib/api/v3/builds.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index 3c1c412ba42..a116ab3c9bd 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -136,7 +136,7 @@ module API
authorize_update_builds!
build = find_build!(params[:job_id])
- authorize!(:update_build, build)
+ authorize!(:erase_build, build)
return forbidden!('Job is not erasable!') unless build.erasable?
build.erase(erased_by: current_user)
diff --git a/lib/api/v3/builds.rb b/lib/api/v3/builds.rb
index f493fd7c7ec..fa0bef39602 100644
--- a/lib/api/v3/builds.rb
+++ b/lib/api/v3/builds.rb
@@ -169,7 +169,7 @@ module API
authorize_update_builds!
build = get_build!(params[:build_id])
- authorize!(:update_build, build)
+ authorize!(:erase_build, build)
return forbidden!('Build is not erasable!') unless build.erasable?
build.erase(erased_by: current_user)