diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-06-08 19:13:31 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2019-06-12 19:10:44 +0300 |
commit | 9384eeeb6d4d7fd04179a46dce75faef69cef3a0 (patch) | |
tree | 8822d335521a4a0ba884d1883769379e484afaa2 /lib | |
parent | 52b2b32517b3782cd009dc2a209c0eb274ddf3ce (diff) |
Gate MR head_pipeline behind read_pipeline ability
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index b1b6e7bd7b9..79fb2d55d1c 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -751,7 +751,9 @@ module API merge_request.metrics&.pipeline end - expose :head_pipeline, using: 'API::Entities::Pipeline' + expose :head_pipeline, using: 'API::Entities::Pipeline', if: -> (_, options) do + Ability.allowed?(options[:current_user], :read_pipeline, options[:project]) + end expose :diff_refs, using: Entities::DiffRefs |