From 721478123068c6718ec73c72a7b7d32c00c816df Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Wed, 16 Nov 2016 19:48:54 +0800
Subject: [PATCH] Also need to check against push rules:

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18440615
---
 lib/gitlab/git_access.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index b462cffeaf6..19bdfc878b1 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -91,7 +91,7 @@ module Gitlab
     def deploy_key_push_access_check(changes)
       if deploy_key.can_push_to?(project)
         check_repository_existence!
-        check_change_access!(changes) if user
+        check_change_access!(changes)
       else
         raise UnauthorizedError, ERROR_MESSAGES[:deploy_key]
       end
-- 
GitLab