debian-mirror-gitlab/app/policies/ci/trigger_policy.rb
2017-08-17 22:00:37 +05:30

13 lines
270 B
Ruby

module Ci
class TriggerPolicy < BasePolicy
def rules
delegate! @subject.project
if can?(:admin_build)
can! :admin_trigger if @subject.owner.blank? ||
@subject.owner == @user
can! :manage_trigger
end
end
end
end