gitlab-org--gitlab-foss/app/policies/ci/runner_policy.rb
2017-04-09 13:20:57 +11:00

13 lines
279 B
Ruby

module Ci
class RunnerPolicy < BasePolicy
def rules
return unless @user
can! :assign_runner if @user.admin?
return if @subject.is_shared? || @subject.locked?
can! :assign_runner if @user.ci_authorized_runners.include?(@subject)
end
end
end