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