BigW Consortium Gitlab

commit_status_policy.rb 203 Bytes
Newer Older
1
class CommitStatusPolicy < BasePolicy
2 3 4 5
  delegate { @subject.project }

  %w[read create update admin].each do |action|
    rule { ~can?(:"#{action}_commit_status") }.prevent :"#{action}_build"
6 7
  end
end