diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index e7bf1ff42a5..5bb06cdbb4a 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -557,6 +557,14 @@ class Namespace < ApplicationRecord cluster_enabled_granted? || certificate_based_clusters_enabled_ff? end + def enabled_git_access_protocol + # If the instance-level setting is enabled, we defer to that + return ::Gitlab::CurrentSettings.enabled_git_access_protocol unless ::Gitlab::CurrentSettings.enabled_git_access_protocol.blank? + + # Otherwise we use the stored setting on the group + namespace_settings&.enabled_git_access_protocol + end + private def cluster_enabled_granted? |