gitlab-org--gitlab-foss/app/policies/commit_status_policy.rb

8 lines
203 B
Ruby
Raw Normal View History

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