Commit e9bef9c00755b09b98fb0961575a12bcaf031bfa

Authored by Dmitriy Zaporozhets
2 parents 439d03bb 6cf5d7c9

Merge pull request #2258 from jasl8r/issue-2193-grack-read-only-access

Support read-only access for git over HTTP
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
lib/gitlab/backend/grack_auth.rb
... ... @@ -38,12 +38,12 @@ module Grack
38 38 end
39 39  
40 40 def validate_get_request
41   - true
  41 + can?(user, :download_code, project)
42 42 end
43 43  
44 44 def validate_post_request
45 45 if @request.path_info.end_with?('git-upload-pack')
46   - can?(user, :push_code, project)
  46 + can?(user, :download_code, project)
47 47 elsif @request.path_info.end_with?('git-receive-pack')
48 48 action = if project.protected_branch?(current_ref)
49 49 :push_code_to_protected_branches
... ...