Authorize read_pipeline before read_build

This commit is contained in:
Matija Čupić 2018-12-18 14:36:26 +01:00
parent a1c77f2d34
commit 89b856e76c
No known key found for this signature in database
GPG key ID: 4BAF84FFACD2E5DE

View file

@ -59,6 +59,7 @@ module API
# rubocop: disable CodeReuse/ActiveRecord
get ':id/pipelines/:pipeline_id/jobs' do
pipeline = user_project.ci_pipelines.find(params[:pipeline_id])
authorize!(:read_pipeline, user_project)
authorize!(:read_build, pipeline)
builds = pipeline.builds