diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-18 04:11:04 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-18 04:23:55 +0800 |
commit | e72e2f9ba0a160960f68035fbbdbe3f0f86b0dba (patch) | |
tree | 01aa834458c4fae17c1ba3439c593765bab5bda9 | |
parent | 0c532dbb243bf9bb5bf77248ce87a2a0e4478421 (diff) | |
download | gitlab-ce-e72e2f9ba0a160960f68035fbbdbe3f0f86b0dba.tar.gz |
Still grant :download_code if guest could do that
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18518792
-rw-r--r-- | lib/gitlab/git_access.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index d5690f870e9..3f674532488 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -48,11 +48,9 @@ module Gitlab deploy_key.has_access_to?(project) elsif user user_download_access_check - elsif Guest.can?(:download_code, project) - true - else - raise UnauthorizedError, ERROR_MESSAGES[:download] - end + end || + Guest.can?(:download_code, project) || + raise(UnauthorizedError, ERROR_MESSAGES[:download]) end def push_access_check(changes) |