diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-12 04:16:39 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-12-12 04:16:39 -0800 |
commit | e9bef9c00755b09b98fb0961575a12bcaf031bfa (patch) | |
tree | 375e48492a9dfa982e9a7ea3036677fd45b2da02 /lib | |
parent | 439d03bbedd2dfcd5ddcb5dc16afe610208188b0 (diff) | |
parent | 6cf5d7c96d8fcbf7b1c05481710afc79c2f7aa21 (diff) | |
download | gitlab-ce-e9bef9c00755b09b98fb0961575a12bcaf031bfa.tar.gz |
Merge pull request #2258 from jasl8r/issue-2193-grack-read-only-access
Support read-only access for git over HTTP
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 4 |
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 |