summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-10-04 17:45:40 -0400
committerSimo Sorce <ssorce@redhat.com>2010-10-28 15:15:52 -0400
commitc25d62965af9dffc655d659dfcd1f39e8d08e66c (patch)
tree7b939938c863b67fd65253f45d9d486b58b92627 /ipalib/plugins/baseldap.py
parent47629a604d7f312ccb32e6b260782cb7c5c70954 (diff)
downloadfreeipa-c25d62965af9dffc655d659dfcd1f39e8d08e66c.tar.gz
freeipa-c25d62965af9dffc655d659dfcd1f39e8d08e66c.tar.xz
freeipa-c25d62965af9dffc655d659dfcd1f39e8d08e66c.zip
Populate indirect members when showing a group object.
This is done by creating a new attribute, memberindirect, to hold this indirect membership. The new function get_members() can return all members or just indirect or direct. We are only using it to retrieve indirect members currently. This also: * Moves all member display attributes into baseldap.py to reduce duplication * Adds netgroup nesting * Use a unique object name in hbacsvc and hbacsvcgroup ticket 296
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py108
1 files changed, 98 insertions, 10 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 91aa39650..f764efbb7 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -32,6 +32,93 @@ from ipalib import output
from ipalib.text import _
from ipalib.util import json_serialize
+global_output_params = (
+ Str('member',
+ label=_('Failed members'),
+ ),
+ Str('member_user?',
+ label=_('Member users'),
+ ),
+ Str('member_group?',
+ label=_('Member groups'),
+ ),
+ Str('member_host?',
+ label=_('Member hosts'),
+ ),
+ Str('memberof_hostgroup?',
+ label=_('Member of host-groups'),
+ ),
+ Str('memberof_taskgroup?',
+ label=_('Member of task-groups'),
+ ),
+ Str('member_rolegroup?',
+ label=_('Member role-groups'),
+ ),
+ Str('member_netgroup?',
+ label=_('Member netgroups'),
+ ),
+ Str('memberof_netgroup?',
+ label=_('Member of netgroups'),
+ ),
+ Str('member_service?',
+ label=_('Member services'),
+ ),
+ Str('member_servicegroup?',
+ label=_('Member service groups'),
+ ),
+ Str('memberof_servicegroup?',
+ label='Member of service groups',
+ ),
+ Str('member_hbacsvcgroup?',
+ label=_('Member HBAC service groups'),
+ ),
+ Str('memberof_hbacsvcgroup?',
+ label='Member of HBAC service groups',
+ ),
+ Str('member_sudocmdgroup?',
+ label='Member SUDO command groups',
+ ),
+ Str('member_sudocmd?',
+ label='Member SUDO commands',
+ ),
+ Str('memberindirect_user?',
+ label=_('Indirect Member users'),
+ ),
+ Str('memberindirect_group?',
+ label=_('Indirect Member groups'),
+ ),
+ Str('memberindirect_host?',
+ label=_('Indirect Member hosts'),
+ ),
+ Str('memberindirect_hostgroup?',
+ label=_('Indirect Member host-groups'),
+ ),
+ Str('memberindirect_rolegroup?',
+ label=_('Indirect Member role-groups'),
+ ),
+ Str('memberindirect_taskgroup?',
+ label=_('Indirect Member role-groups'),
+ ),
+ Str('memberindirect_hbacsvc?',
+ label=_('Indirect Member HBAC service'),
+ ),
+ Str('memberindirect_hbacsvcgrp?',
+ label=_('Indirect Member HBAC service group'),
+ ),
+ Str('memberindirect_netgroup?',
+ label=_('Indirect Member netgroups'),
+ ),
+ Str('memberindirect_sudocmdgroup?',
+ label='Indirect Member SUDO command groups',
+ ),
+ Str('memberindirect_sudocmd?',
+ label='Indirect Member SUDO commands',
+ ),
+ Str('externalhost?',
+ label=_('External host'),
+ ),
+)
+
def validate_add_attribute(ugettext, attr):
validate_attribute(ugettext, 'addattr', attr)
@@ -273,6 +360,8 @@ class LDAPCreate(CallbackInterface, crud.Create):
for arg in super(crud.Create, self).get_args():
yield arg
+ has_output_params = global_output_params
+
def execute(self, *keys, **options):
ldap = self.obj.backend
@@ -425,6 +514,7 @@ class LDAPRetrieve(LDAPQuery):
Retrieve an LDAP entry.
"""
has_output = output.standard_entry
+ has_output_params = global_output_params
takes_options = (
Flag('rights',
@@ -502,6 +592,8 @@ class LDAPUpdate(LDAPQuery, crud.Update):
takes_options = _attr_options
+ has_output_params = global_output_params
+
def execute(self, *keys, **options):
ldap = self.obj.backend
@@ -630,6 +722,8 @@ class LDAPDelete(LDAPMultiQuery):
"""
has_output = output.standard_delete
+ has_output_params = global_output_params
+
def execute(self, *keys, **options):
ldap = self.obj.backend
@@ -765,11 +859,7 @@ class LDAPAddMember(LDAPModMember):
),
)
- has_output_params = (
- Str('member',
- label=_('Failed members'),
- ),
- )
+ has_output_params = global_output_params
def execute(self, *keys, **options):
ldap = self.obj.backend
@@ -870,11 +960,7 @@ class LDAPRemoveMember(LDAPModMember):
),
)
- has_output_params = (
- Str('member',
- label=_('Failed members'),
- ),
- )
+ has_output_params = global_output_params
def execute(self, *keys, **options):
ldap = self.obj.backend
@@ -989,6 +1075,8 @@ class LDAPSearch(CallbackInterface, crud.Search):
for option in super(LDAPSearch, self).get_options():
yield option
+ has_output_params = global_output_params
+
def execute(self, *args, **options):
ldap = self.obj.backend