From 6cf5d7c96d8fcbf7b1c05481710afc79c2f7aa21 Mon Sep 17 00:00:00 2001 From: Jeremy Slater Date: Tue, 11 Dec 2012 15:28:40 -0500 Subject: [PATCH] Support read-only access for git over HTTP --- lib/gitlab/backend/grack_auth.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index 9fafc96..7c31117 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -38,12 +38,12 @@ module Grack end def validate_get_request - true + can?(user, :download_code, project) end def validate_post_request if @request.path_info.end_with?('git-upload-pack') - can?(user, :push_code, project) + can?(user, :download_code, project) elsif @request.path_info.end_with?('git-receive-pack') action = if project.protected_branch?(current_ref) :push_code_to_protected_branches -- libgit2 0.21.2