summaryrefslogtreecommitdiff
path: root/app/models/namespace_setting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace_setting.rb')
-rw-r--r--app/models/namespace_setting.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespace_setting.rb b/app/models/namespace_setting.rb
index 5081d5cdafe..7f65fb3a378 100644
--- a/app/models/namespace_setting.rb
+++ b/app/models/namespace_setting.rb
@@ -69,6 +69,12 @@ class NamespaceSetting < ApplicationRecord
!self.class.where(namespace_id: namespace.ancestors, runner_registration_enabled: false).exists?
end
+ def allow_runner_registration_token?
+ settings = Gitlab::CurrentSettings.current_application_settings
+
+ settings.allow_runner_registration_token && namespace.root_ancestor.allow_runner_registration_token
+ end
+
private
def all_ancestors_allow_diff_preview_in_email?