summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-01-16 11:14:59 +0100
committerMartin Kosek <mkosek@redhat.com>2012-01-16 20:08:13 +0100
commit7f6c9ac04c751063c932109855cf02c26a50a6ee (patch)
tree1524985a358628bd0ce9abc357458ce35da5a490 /ipalib/plugins/baseldap.py
parentf7753bf55cf713b93f1c12d0fc6dde7f804dd975 (diff)
downloadfreeipa.git-7f6c9ac04c751063c932109855cf02c26a50a6ee.tar.gz
freeipa.git-7f6c9ac04c751063c932109855cf02c26a50a6ee.tar.xz
freeipa.git-7f6c9ac04c751063c932109855cf02c26a50a6ee.zip
Add missing --pkey-only option for selfservice and delegation
pkey-only functionality has to be implemented separately for these modules as they are based on crud.Search instead of standard LDAPSearch. Delegation moduled was also fixed to support new format of ACI's memberof attribute introduced in patch "Display the value of memberOf ACIs in permission plugin." https://fedorahosted.org/freeipa/ticket/2092
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 82ccf376..3d648045 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -1552,6 +1552,12 @@ class LDAPRemoveMember(LDAPModMember):
return
+def gen_pkey_only_option(cli_name):
+ return Flag('pkey_only?',
+ label=_('Primary key only'),
+ doc=_('Results should contain primary key attribute only ("%s")') \
+ % to_cli(cli_name),)
+
class LDAPSearch(BaseLDAPCommand, crud.Search):
"""
Retrieve all LDAP entries matching the given criteria.
@@ -1594,11 +1600,7 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
yield option
if self.obj.primary_key and \
'no_output' not in self.obj.primary_key.flags:
- yield Flag('pkey_only?',
- label=_('Primary key only'),
- doc=_('Results should contain primary key attribute only ("%s")') \
- % to_cli(self.obj.primary_key.cli_name),
- )
+ yield gen_pkey_only_option(self.obj.primary_key.cli_name)
for attr in self.member_attributes:
for ldap_obj_name in self.obj.attribute_members[attr]:
ldap_obj = self.api.Object[ldap_obj_name]