debian-mirror-gitlab/app/policies/ci/pipeline_schedule_policy.rb

15 lines
378 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
module Ci
class PipelineSchedulePolicy < PipelinePolicy
2017-09-10 17:25:29 +05:30
alias_method :pipeline_schedule, :subject
condition(:owner_of_schedule) do
can?(:developer_access) && pipeline_schedule.owned_by?(@user)
end
rule { can?(:master_access) | owner_of_schedule }.policy do
enable :update_pipeline_schedule
enable :admin_pipeline_schedule
end
2017-08-17 22:00:37 +05:30
end
end