Commit 08ed07cf authored by Shinya Maeda's avatar Shinya Maeda

Improve PipelineSchedulePolicy

parent c1388df0
...@@ -5,11 +5,15 @@ module Ci ...@@ -5,11 +5,15 @@ module Ci
def rules def rules
super super
access = pipeline_schedule.project.team.max_member_access(user.id) if owned_by_developer? && pipeline_schedule.owner != user
if access == Gitlab::Access::DEVELOPER && pipeline_schedule.owner != user
cannot! :update_pipeline_schedule cannot! :update_pipeline_schedule
end end
end end
private
def owned_by_developer?
pipeline_schedule.project.team.developer?(user)
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment