summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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?