Commit 337f5dcf authored by James Lopez's avatar James Lopez

refactor ldap/sync/group.rb

parent 410dd66f
...@@ -84,9 +84,7 @@ module EE ...@@ -84,9 +84,7 @@ module EE
private private
def update_access_levels(access_levels, group_link) def update_access_levels(access_levels, group_link)
if config.group_base.blank? && group_link.cn if member_dns = get_member_dns(group_link)
logger.debug { "No `group_base` configured for '#{provider}' provider and group link CN #{group_link.cn}. Skipping" }
elsif member_dns = get_member_dns(group_link)
access_levels.set(member_dns, to: group_link.group_access) access_levels.set(member_dns, to: group_link.group_access)
logger.debug do logger.debug do
...@@ -100,6 +98,12 @@ module EE ...@@ -100,6 +98,12 @@ module EE
end end
def dns_for_group_cn(group_cn) def dns_for_group_cn(group_cn)
if config.group_base.blank?
logger.debug { "No `group_base` configured for '#{provider}' provider and group link CN #{group_link.cn}. Skipping" }
return nil
end
proxy.dns_for_group_cn(group_cn) proxy.dns_for_group_cn(group_cn)
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