diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-06-26 12:25:08 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-07-05 12:36:18 +0300 |
commit | 1247ae0de9a365859db14812db7b1ddeacbd87f4 (patch) | |
tree | d6f4ca3cd919515ae244cf84411fab167cc2edb8 /app/policies/ci | |
parent | 3ea04616c38493ae03b31f54c88b6551b6d65b6f (diff) |
Add functionality and security.
Diffstat (limited to 'app/policies/ci')
-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 |