gitlab-org--gitlab-foss/app/policies/ci/pipeline_schedule_policy.rb

15 lines
378 B
Ruby
Raw Normal View History

module Ci
class PipelineSchedulePolicy < PipelinePolicy
2017-06-26 05:25:08 -04:00
alias_method :pipeline_schedule, :subject
condition(:owner_of_schedule) do
can?(:developer_access) && pipeline_schedule.owned_by?(@user)
2017-06-28 08:42:13 -04:00
end
2017-06-27 03:16:15 -04:00
rule { can?(:master_access) | owner_of_schedule }.policy do
enable :update_pipeline_schedule
enable :admin_pipeline_schedule
2017-06-28 08:42:13 -04:00
end
end
end