summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Slater <jeremy.slater@nuance.com>2012-12-11 15:28:40 -0500
committerJeremy Slater <jeremy.slater@nuance.com>2012-12-11 15:28:40 -0500
commit6cf5d7c96d8fcbf7b1c05481710afc79c2f7aa21 (patch)
tree62daeab6cdc587a950d7be6dc96096363189bed0 /lib
parent7f636b1306e821111555c9042b4cddc98b3dc666 (diff)
downloadgitlab-ce-6cf5d7c96d8fcbf7b1c05481710afc79c2f7aa21.tar.gz
Support read-only access for git over HTTP
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/backend/grack_auth.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index 9fafc9617d1..7c31117f01d 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