Skip to content
Snippets Groups Projects

Add routes to allow git actions on snippet repositories

All threads resolved!
6 files
+ 42
25
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -6,7 +6,7 @@ class GitHttpClientController < Repositories::ApplicationController
@@ -6,7 +6,7 @@ class GitHttpClientController < Repositories::ApplicationController
include KerberosSpnegoHelper
include KerberosSpnegoHelper
include Gitlab::Utils::StrongMemoize
include Gitlab::Utils::StrongMemoize
attr_reader :authentication_result, :redirected_path
attr_reader :authentication_result, :redirected_path, :container
delegate :actor, :authentication_abilities, to: :authentication_result, allow_nil: true
delegate :actor, :authentication_abilities, to: :authentication_result, allow_nil: true
delegate :type, to: :authentication_result, allow_nil: true, prefix: :auth_result
delegate :type, to: :authentication_result, allow_nil: true, prefix: :auth_result
@@ -93,7 +93,7 @@ def render_missing_personal_access_token
@@ -93,7 +93,7 @@ def render_missing_personal_access_token
def repository
def repository
strong_memoize(:repository) do
strong_memoize(:repository) do
repo_type.repository_for(@container)
repo_type.repository_for(container)
end
end
end
end
@@ -117,7 +117,8 @@ def ci?
@@ -117,7 +117,8 @@ def ci?
def http_download_allowed?
def http_download_allowed?
Gitlab::ProtocolAccess.allowed?('http') &&
Gitlab::ProtocolAccess.allowed?('http') &&
download_request? &&
download_request? &&
(project && Guest.can?(:download_code, project) || @container.is_a?(PersonalSnippet))
container &&
 
Guest.can?(:download_code, container)
end
end
end
end
end
end
Loading