summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/pwpolicy.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-11-09 16:05:54 -0500
committerAdam Young <ayoung@redhat.com>2010-11-19 12:36:31 -0500
commit1b166c9e8b16a740442a913446fee9be5eda40de (patch)
tree5abd179214d052413213a3cfb7d33354190436e8 /ipalib/plugins/pwpolicy.py
parentc07bac8c0057e4ad1d10ce34b7d0dc0b6f6539a4 (diff)
downloadfreeipa-1b166c9e8b16a740442a913446fee9be5eda40de.tar.gz
freeipa-1b166c9e8b16a740442a913446fee9be5eda40de.tar.xz
freeipa-1b166c9e8b16a740442a913446fee9be5eda40de.zip
Fix returning effective rights for password policy.
This also returns the rights for cospriority if the policy is for a group. ticket 449
Diffstat (limited to 'ipalib/plugins/pwpolicy.py')
-rw-r--r--ipalib/plugins/pwpolicy.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index 7a83216f3..f1e708e71 100644
--- a/ipalib/plugins/pwpolicy.py
+++ b/ipalib/plugins/pwpolicy.py
@@ -401,7 +401,7 @@ class pwpolicy_show(LDAPRetrieve):
"""
Display information about password policy.
"""
- takes_options = (
+ takes_options = LDAPRetrieve.takes_options + (
Str('user?',
label=_('User'),
doc=_('Display effective policy for a specific user'),
@@ -428,6 +428,10 @@ class pwpolicy_show(LDAPRetrieve):
entry_attrs['cospriority'] = cos_entry['cospriority']
except errors.NotFound:
pass
+ if options.get('rights', False) and options.get('all', False) and \
+ keys[-1] is not None:
+ cos_entry = self.api.Command.cosentry_show(keys[-1], rights=True, all=True)['result']
+ entry_attrs['attributelevelrights']['cospriority'] = cos_entry['attributelevelrights']['cospriority']
self.obj.convert_time_for_output(entry_attrs, **options)
return dn