gitlab-org--gitlab-foss/app/policies/ci/trigger_policy.rb

14 lines
270 B
Ruby
Raw Normal View History

2017-03-07 08:02:56 -05:00
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