Commit 797e807249076920d6c4bb71f6258ca05ee0db34
1 parent
11dba4ce
Exists in
spb-stable
and in
2 other branches
Use LDAP::Access.open to reuse the LDAP connection
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/gitlab/git_access.rb
@@ -66,8 +66,8 @@ module Gitlab | @@ -66,8 +66,8 @@ module Gitlab | ||
66 | if Gitlab.config.ldap.enabled | 66 | if Gitlab.config.ldap.enabled |
67 | if user.ldap_user? | 67 | if user.ldap_user? |
68 | # Check if LDAP user exists and match LDAP user_filter | 68 | # Check if LDAP user exists and match LDAP user_filter |
69 | - unless Gitlab::LDAP::Access.new.allowed?(user) | ||
70 | - return false | 69 | + Gitlab::LDAP::Access.open do |adapter| |
70 | + return false unless adapter.allowed?(user) | ||
71 | end | 71 | end |
72 | end | 72 | end |
73 | end | 73 | end |