diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 22:20:44 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-06 22:20:44 +0900 |
commit | 9b58b8e363fd388635385085c58be3d4637eaa45 (patch) | |
tree | e348f8d2cf9030d59448cea3dbc459a29bbecf95 /lib/api | |
parent | d4ceec9d47a7da5fa17cb6e161ac491e13fcb8bd (diff) | |
download | gitlab-ce-9b58b8e363fd388635385085c58be3d4637eaa45.tar.gz |
Do not allow jobs to be erased
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/jobs.rb | 2 | ||||
-rw-r--r-- | lib/api/v3/builds.rb | 2 |
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) |