summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/netgroup.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2011-01-04 15:15:54 -0500
committerAdam Young <ayoung@redhat.com>2011-01-04 21:56:38 -0500
commitd6d579ead469e0b4690d6d1eec0f137dd3c40940 (patch)
treec8d6a027f5fe598b75687aa42dd193b2c51cf816 /ipalib/plugins/netgroup.py
parent4f2a6e0a25cd5d92bdd436d23963f77b86f818ea (diff)
downloadfreeipa-d6d579ead469e0b4690d6d1eec0f137dd3c40940.tar.gz
freeipa-d6d579ead469e0b4690d6d1eec0f137dd3c40940.tar.xz
freeipa-d6d579ead469e0b4690d6d1eec0f137dd3c40940.zip
Improve filtering of enrollments search results.
This is required for effective filtering of enrollments search results in the webUI and also gives an edge to the CLI. After this patch, each LDAPObject can define its relationships to other LDAPObjects. For now, this is used only for filtering search results by enrollments, but there are probably more benefits to come. You can do this for example: # search for all users not enrolled in group admins ipa user-find --not-in-groups=admins # search for all groups not enrolled in group global with user Pavel ipa group-find --users=Pavel --not-in-groups=global # more examples: ipa group-find --users=Pavel,Jakub --no-users=Honza ipa hostgroup-find --hosts=webui.pzuna
Diffstat (limited to 'ipalib/plugins/netgroup.py')
-rw-r--r--ipalib/plugins/netgroup.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py
index 83e699908..ce9a51b6c 100644
--- a/ipalib/plugins/netgroup.py
+++ b/ipalib/plugins/netgroup.py
@@ -85,6 +85,15 @@ class netgroup(LDAPObject):
'memberuser': ['user', 'group'],
'memberhost': ['host', 'hostgroup'],
}
+ relationships = {
+ 'member': ('Member', '', 'no_'),
+ 'memberof': ('Parent', 'in_', 'not_in_'),
+ 'memberindirect': (
+ 'Indirect Member', None, 'no_indirect_'
+ ),
+ 'memberuser': ('Member', '', 'no_'),
+ 'memberhost': ('Member', '', 'no_'),
+ }
label = _('Net Groups')
@@ -171,7 +180,7 @@ class netgroup_find(LDAPSearch):
"""
Search for a netgroup.
"""
- member_attributes = ['member', 'memberuser', 'memberhost']
+ member_attributes = ['member', 'memberuser', 'memberhost', 'memberof']
has_output_params = LDAPSearch.has_output_params + output_params
msg_summary = ngettext(
'%(count)d netgroup matched', '%(count)d netgroups matched'