2017-05-07 18:35:56 -04:00
|
|
|
module Ci
|
|
|
|
class PipelineSchedulePolicy < PipelinePolicy
|
2017-06-26 05:25:08 -04:00
|
|
|
alias_method :pipeline_schedule, :subject
|
|
|
|
|
2017-07-07 06:09:35 -04:00
|
|
|
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
|
|
|
|
2017-07-07 06:09:35 -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
|
2017-05-07 18:35:56 -04:00
|
|
|
end
|
|
|
|
end
|