gitlab-org--gitlab-foss/app/policies/commit_status_policy.rb
2017-06-27 12:44:37 -07:00

7 lines
203 B
Ruby

class CommitStatusPolicy < BasePolicy
delegate { @subject.project }
%w[read create update admin].each do |action|
rule { ~can?(:"#{action}_commit_status") }.prevent :"#{action}_build"
end
end