Skip to content

Commit db248e1

Browse files
committed
Accept optional depth setting
1 parent 6942a49 commit db248e1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/github/ldap/member_of/recursive.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ class Recursive
1010
# Internal: The GitHub::Ldap object to search domains with.
1111
attr_reader :ldap
1212

13+
# Internal: The maximum depth to search for subgroups.
14+
attr_reader :depth
15+
1316
# Public: Instantiate new search strategy.
1417
#
1518
# - ldap: GitHub::Ldap object
16-
# - options: Hash of options (unused)
19+
# - options: Hash of options
1720
def initialize(ldap, options = {})
1821
@ldap = ldap
1922
@options = options
23+
@depth = options[:depth]
2024
end
2125

2226
# Public: Performs search for groups an entry is a member of, including
@@ -51,7 +55,9 @@ def domains
5155
# subgroups with.
5256
def search_strategy
5357
@search_strategy ||=
54-
GitHub::Ldap::Members::Recursive.new(ldap, attrs: %w(objectClass))
58+
GitHub::Ldap::Members::Recursive.new ldap,
59+
depth: depth,
60+
attrs: %w(objectClass)
5561
end
5662

5763
# Internal: Returns true if the entry is a group.

0 commit comments

Comments
 (0)