diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-11 21:24:21 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-11 21:24:21 +0800 |
commit | 38fbcb99dba61cfae1b788e0ec947911c4d14dd8 (patch) | |
tree | 710226786fac00a8772568803c11c5a630496810 /lib | |
parent | 24d9f51e7bfbfa4a063b068377b100f6cde2b971 (diff) | |
download | gitlab-ce-38fbcb99dba61cfae1b788e0ec947911c4d14dd8.tar.gz |
So deploy key might not have a corresponding user
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git_access.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 819e0657bdd..78f562821ea 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -46,7 +46,7 @@ module Gitlab def download_access_check if user user_download_access_check - elsif !Guest.can?(:download_code, project) + elsif deploy_key.nil? && !Guest.can?(:download_code, project) raise UnauthorizedError, ERROR_MESSAGES[:download] end end @@ -91,7 +91,7 @@ module Gitlab def deploy_key_push_access_check(changes) if deploy_key.can_push? check_repository_existence! - check_change_access!(changes) + check_change_access!(changes) if user else raise UnauthorizedError, ERROR_MESSAGES[:deploy_key] end |