permission: handle ipapermright deprecated CLI alias on the client

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta 2016-06-20 12:37:48 +02:00
parent 71de8878bd
commit 3ec7a52aea
3 changed files with 34 additions and 4 deletions

View File

@ -3364,7 +3364,7 @@ option: Str('extratargetfilter*', cli_name='filter')
option: Str('filter*')
option: StrEnum('ipapermbindruletype', autofill=True, cli_name='bindtype', default=u'permission', values=[u'permission', u'all', u'anonymous'])
option: DNOrURL('ipapermlocation?', alwaysask=True, autofill=False, cli_name='subtree')
option: StrEnum('ipapermright*', alwaysask=True, autofill=False, cli_name='right', deprecated_cli_aliases=['permissions'], values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: StrEnum('ipapermright*', alwaysask=True, autofill=False, cli_name='right', values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: DNParam('ipapermtarget?', cli_name='target')
option: Str('ipapermtargetfilter*', cli_name='rawfilter')
option: DNParam('ipapermtargetfrom?', cli_name='targetfrom')
@ -3425,7 +3425,7 @@ option: Str('ipapermdefaultattr*', autofill=False, cli_name='defaultattrs')
option: Str('ipapermexcludedattr*', autofill=False, cli_name='excludedattrs')
option: Str('ipapermincludedattr*', autofill=False, cli_name='includedattrs')
option: DNOrURL('ipapermlocation?', autofill=False, cli_name='subtree')
option: StrEnum('ipapermright*', autofill=False, cli_name='right', deprecated_cli_aliases=['permissions'], values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: StrEnum('ipapermright*', autofill=False, cli_name='right', values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: DNParam('ipapermtarget?', autofill=False, cli_name='target')
option: Str('ipapermtargetfilter*', autofill=False, cli_name='rawfilter')
option: DNParam('ipapermtargetfrom?', autofill=False, cli_name='targetfrom')
@ -3458,7 +3458,7 @@ option: StrEnum('ipapermbindruletype?', autofill=False, cli_name='bindtype', def
option: Str('ipapermexcludedattr*', autofill=False, cli_name='excludedattrs')
option: Str('ipapermincludedattr*', autofill=False, cli_name='includedattrs')
option: DNOrURL('ipapermlocation?', autofill=False, cli_name='subtree')
option: StrEnum('ipapermright*', autofill=False, cli_name='right', deprecated_cli_aliases=['permissions'], values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: StrEnum('ipapermright*', autofill=False, cli_name='right', values=[u'read', u'search', u'compare', u'write', u'add', u'delete', u'all'])
option: DNParam('ipapermtarget?', autofill=False, cli_name='target')
option: Str('ipapermtargetfilter*', autofill=False, cli_name='rawfilter')
option: DNParam('ipapermtargetfrom?', autofill=False, cli_name='targetfrom')

View File

@ -0,0 +1,31 @@
#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
from ipaclient.frontend import MethodOverride
from ipalib.plugable import Registry
register = Registry()
class PermissionMethodOverride(MethodOverride):
def get_options(self):
for option in super(PermissionMethodOverride, self).get_options():
if option.name == 'ipapermright':
option = option.clone(deprecated_cli_aliases={'permissions'})
yield option
@register(override=True)
class permission_add(PermissionMethodOverride):
pass
@register(override=True)
class permission_mod(PermissionMethodOverride):
pass
@register(override=True)
class permission_find(PermissionMethodOverride):
pass

View File

@ -243,7 +243,6 @@ class permission(baseldap.LDAPObject):
StrEnum(
'ipapermright*',
cli_name='right',
deprecated_cli_aliases={'permissions'},
label=_('Granted rights'),
doc=_('Rights to grant '
'(read, search, compare, write, add, delete, all)'),