diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-30 19:57:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-30 19:57:06 +0300 |
commit | b4cf4027c64afc4f009452a9bfade231e2ff421a (patch) | |
tree | cfa307b5d1583471285709032f559ab2ac4be1d5 /lib/api | |
parent | 0cb369aa5f70b59e5922d8f5431a3302fd93574e (diff) |
Add latest changes from gitlab-org/security/gitlab@13-5-stable-ee
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/ci/pipeline_schedules.rb | 2 | ||||
-rw-r--r-- | lib/api/entities/ci/pipeline_schedule_details.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/ci/pipeline_schedules.rb b/lib/api/ci/pipeline_schedules.rb index 18caf85f109..b669acf668c 100644 --- a/lib/api/ci/pipeline_schedules.rb +++ b/lib/api/ci/pipeline_schedules.rb @@ -36,7 +36,7 @@ module API requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id' end get ':id/pipeline_schedules/:pipeline_schedule_id' do - present pipeline_schedule, with: Entities::Ci::PipelineScheduleDetails + present pipeline_schedule, with: Entities::Ci::PipelineScheduleDetails, user: current_user end desc 'Create a new pipeline schedule' do diff --git a/lib/api/entities/ci/pipeline_schedule_details.rb b/lib/api/entities/ci/pipeline_schedule_details.rb index b233728b95b..d661a8940ea 100644 --- a/lib/api/entities/ci/pipeline_schedule_details.rb +++ b/lib/api/entities/ci/pipeline_schedule_details.rb @@ -5,7 +5,9 @@ module API module Ci class PipelineScheduleDetails < PipelineSchedule expose :last_pipeline, using: ::API::Entities::Ci::PipelineBasic - expose :variables, using: ::API::Entities::Ci::Variable + expose :variables, + using: ::API::Entities::Ci::Variable, + if: ->(schedule, options) { Ability.allowed?(options[:user], :read_pipeline_schedule_variables, schedule) } end end end |