mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Cleanup for netgroup search https://fedorahosted.org/freeipa/ticket/963
This commit is contained in:
parent
bc8d33307a
commit
478186e485
@ -197,11 +197,13 @@ class netgroup_find(LDAPSearch):
|
||||
# Do not display private mepManagedEntry netgroups by default
|
||||
# If looking for private groups, we need to omit the negation search filter
|
||||
|
||||
if not options['private']:
|
||||
search_kw = self.args_options_2_entry(**options)
|
||||
search_kw = {}
|
||||
search_kw['objectclass'] = ['mepManagedEntry']
|
||||
negation = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE)
|
||||
filter = ldap.combine_filters((negation, filter), rules='&')
|
||||
if not options['private']:
|
||||
local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_NONE)
|
||||
else:
|
||||
local_filter = ldap.make_filter(search_kw, rules=ldap.MATCH_ALL)
|
||||
filter = ldap.combine_filters((local_filter, filter), rules=ldap.MATCH_ALL)
|
||||
return (filter, base_dn, scope)
|
||||
|
||||
api.register(netgroup_find)
|
||||
|
Loading…
Reference in New Issue
Block a user