debian-mirror-gitlab/app/policies/commit_status_policy.rb

10 lines
234 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-09-29 09:46:39 +05:30
class CommitStatusPolicy < BasePolicy
2017-09-10 17:25:29 +05:30
delegate { @subject.project }
%w[read create update admin].each do |action|
rule { ~can?(:"#{action}_commit_status") }.prevent :"#{action}_build"
2016-09-29 09:46:39 +05:30
end
end