BigW Consortium Gitlab

runner_policy.rb 279 Bytes
Newer Older
1 2 3 4 5
module Ci
  class RunnerPolicy < BasePolicy
    def rules
      return unless @user

6
      can! :assign_runner if @user.admin?
7 8 9 10 11 12 13

      return if @subject.is_shared? || @subject.locked?

      can! :assign_runner if @user.ci_authorized_runners.include?(@subject)
    end
  end
end