From a6533d71f53cd7f97a31100334154a82a9f37deb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 16 Jun 2022 15:09:00 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/namespace.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/namespace.rb') 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? -- cgit v1.2.1