summaryrefslogtreecommitdiff
path: root/lib/gitlab/git_access.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-03-28 18:54:15 +0200
committerDouwe Maan <douwe@selenight.nl>2018-03-28 18:54:15 +0200
commit7bca902a23d0cccaa3bce422fce7fdc71e722db4 (patch)
treef8ce7b3ae1e7982a0a188bc22d4f65dba9035ee1 /lib/gitlab/git_access.rb
parent59d910f2a136a52748326977fcefe2ec16c35d09 (diff)
downloadgitlab-ce-7bca902a23d0cccaa3bce422fce7fdc71e722db4.tar.gz
Fall back on ghost user when deploy key user is not set
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r--lib/gitlab/git_access.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 6400089a22f..6beecea7e73 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -99,8 +99,6 @@ module Gitlab
end
def check_active_user!
- return if deploy_key?
-
if user && !user_access.allowed?
raise UnauthorizedError, ERROR_MESSAGES[:account_blocked]
end
@@ -219,7 +217,7 @@ module Gitlab
raise UnauthorizedError, ERROR_MESSAGES[:read_only]
end
- if deploy_key
+ if deploy_key?
unless deploy_key.can_push_to?(project)
raise UnauthorizedError, ERROR_MESSAGES[:deploy_key_upload]
end
@@ -309,8 +307,10 @@ module Gitlab
case actor
when User
actor
+ when DeployKey
+ nil
when Key
- actor.user unless actor.is_a?(DeployKey)
+ actor.user
when :ci
nil
end