summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-11-06 23:24:25 +0900
committerShinya Maeda <shinya@gitlab.com>2017-11-06 23:24:25 +0900
commitc8eb2a914b6f9348ffa16436853964998c115085 (patch)
tree0c2ba6aa3a7d664663e4af0e571e9d4a7ddda2ac /lib
parent9b58b8e363fd388635385085c58be3d4637eaa45 (diff)
downloadgitlab-ce-c8eb2a914b6f9348ffa16436853964998c115085.tar.gz
Fix spec. Revert update check.
Diffstat (limited to 'lib')
-rw-r--r--lib/api/jobs.rb1
-rw-r--r--lib/api/v3/builds.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index a116ab3c9bd..6dcbe2ff936 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -136,6 +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?
diff --git a/lib/api/v3/builds.rb b/lib/api/v3/builds.rb
index fa0bef39602..1c0f9f73c78 100644
--- a/lib/api/v3/builds.rb
+++ b/lib/api/v3/builds.rb
@@ -169,6 +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?