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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
823f89ed
Commit
823f89ed
authored
Mar 14, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass LDAP adapter to finders in update_permissions
parent
826404a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+2
-2
lib/gitlab/ldap/group.rb
lib/gitlab/ldap/group.rb
+3
-2
No files found.
lib/gitlab/ldap/access.rb
View file @
823f89ed
...
...
@@ -31,13 +31,13 @@ module Gitlab
return
true
unless
Gitlab
.
config
.
ldap
[
'group_base'
].
present?
# Get LDAP user entry
ldap_user
=
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
)
ldap_user
=
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
extern_uid
,
adapter
)
# Get all GitLab groups with activated LDAP
groups
=
::
Group
.
where
(
'ldap_cn IS NOT NULL'
)
# Get LDAP groups based on cn from GitLab groups
ldap_groups
=
groups
.
pluck
(
:ldap_cn
).
map
{
|
cn
|
Gitlab
::
LDAP
::
Group
.
find_by_cn
(
cn
)
}
ldap_groups
=
groups
.
pluck
(
:ldap_cn
).
map
{
|
cn
|
Gitlab
::
LDAP
::
Group
.
find_by_cn
(
cn
,
adapter
)
}
ldap_groups
=
ldap_groups
.
compact
.
uniq
# Iterate over ldap groups and check user membership
...
...
lib/gitlab/ldap/group.rb
View file @
823f89ed
...
...
@@ -7,8 +7,9 @@
module
Gitlab
module
LDAP
class
Group
def
self
.
find_by_cn
(
cn
)
Gitlab
::
LDAP
::
Adapter
.
new
.
group
(
cn
)
def
self
.
find_by_cn
(
cn
,
adapter
=
nil
)
adapter
||=
Gitlab
::
LDAP
::
Adapter
.
new
adapter
.
group
(
cn
)
end
def
initialize
(
entry
)
...
...
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