Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
56df3dbf
Commit
56df3dbf
authored
Mar 14, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Gitlab::LDAP::Access.open
This new method wraps Gitlab::LDAP::Adapter.open to enable connection reuse.
parent
af53aa90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+13
-1
No files found.
lib/gitlab/ldap/access.rb
View file @
56df3dbf
module
Gitlab
module
Gitlab
module
LDAP
module
LDAP
class
Access
class
Access
attr_reader
:adapter
def
self
.
open
(
&
block
)
Gitlab
::
LDAP
::
Adapter
.
open
do
|
adapter
|
block
.
call
(
self
.
new
(
adapter
))
end
end
def
initialize
(
adapter
=
nil
)
@adapter
=
adapter
end
def
allowed?
(
user
)
def
allowed?
(
user
)
!!
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
)
!!
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
,
adapter
)
rescue
rescue
false
false
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment