diff options
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/ci/pipeline_schedule_policy.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/policies/ci/pipeline_schedule_policy.rb b/app/policies/ci/pipeline_schedule_policy.rb index 1877e89bb23..2506c179157 100644 --- a/app/policies/ci/pipeline_schedule_policy.rb +++ b/app/policies/ci/pipeline_schedule_policy.rb @@ -1,4 +1,15 @@ module Ci class PipelineSchedulePolicy < PipelinePolicy + alias_method :pipeline_schedule, :subject + + def rules + super + + access = pipeline_schedule.project.team.max_member_access(user.id) + + if access == Gitlab::Access::DEVELOPER && pipeline_schedule.owner != user + cannot! :update_pipeline_schedule + end + end end end |