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

14 lines
322 B
Ruby
Raw Normal View History

module Ci
class PipelinePolicy < BasePolicy
2017-07-03 17:20:44 -04:00
delegate { @subject.project }
condition(:user_cannot_update) do
!::Gitlab::UserAccess
.new(@user, project: @subject.project)
.can_push_or_merge_to_branch?(@subject.ref)
end
rule { user_cannot_update }.prevent :update_pipeline
end
end