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

19 lines
382 B
Ruby
Raw Normal View History

2023-05-27 22:25:52 +05:30
# frozen_string_literal: true
module Ci
2023-06-20 00:43:36 +05:30
class RunnerManagerPolicy < BasePolicy
2023-05-27 22:25:52 +05:30
with_options scope: :subject, score: 0
condition(:can_read_runner, scope: :subject) do
can?(:read_runner, @subject.runner)
end
rule { anonymous }.prevent_all
rule { can_read_runner }.policy do
enable :read_builds
2023-06-20 00:43:36 +05:30
enable :read_runner_manager
2023-05-27 22:25:52 +05:30
end
end
end