BigW Consortium Gitlab

pipeline_schedule_policy.rb 378 Bytes
Newer Older
1 2
module Ci
  class PipelineSchedulePolicy < PipelinePolicy
3 4
    alias_method :pipeline_schedule, :subject

5 6
    condition(:owner_of_schedule) do
      can?(:developer_access) && pipeline_schedule.owned_by?(@user)
Shinya Maeda committed
7
    end
8

9 10 11
    rule { can?(:master_access) | owner_of_schedule }.policy do
      enable :update_pipeline_schedule
      enable :admin_pipeline_schedule
Shinya Maeda committed
12
    end
13 14
  end
end