Commit 0f69c2f8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

LDAP::Adapter#groups allow size argument

parent 51bee5ec
...@@ -40,12 +40,14 @@ module Gitlab ...@@ -40,12 +40,14 @@ module Gitlab
# Ex. # Ex.
# groups("dev*") # return all groups start with 'dev' # groups("dev*") # return all groups start with 'dev'
# #
def groups(cn = "*") def groups(cn = "*", size = nil)
options = { options = {
base: config['group_base'], base: config['group_base'],
filter: Net::LDAP::Filter.eq("cn", cn) filter: Net::LDAP::Filter.eq("cn", cn)
} }
options.merge!(size: size) if size
ldap.search(options).map do |entry| ldap.search(options).map do |entry|
Gitlab::LDAP::Group.new(entry) Gitlab::LDAP::Group.new(entry)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment