summaryrefslogtreecommitdiff
path: root/app/policies/commit_status_policy.rb
blob: eea2a24fb2d2698cc7896ec531c08193e517c17c (plain)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

class CommitStatusPolicy < BasePolicy
  delegate { @subject.project }

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