debian-mirror-gitlab/app/policies/ci/runner_policy.rb

14 lines
282 B
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
module Ci
class RunnerPolicy < BasePolicy
def rules
return unless @user
can! :assign_runner if @user.is_admin?
return if @subject.is_shared? || @subject.locked?
can! :assign_runner if @user.ci_authorized_runners.include?(@subject)
end
end
end