mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Unable to rename permission object
The update was failing because of the case insensitivity of permission object DN. Unit-tests added. https://fedorahosted.org/freeipa/ticket/2571
This commit is contained in:
committed by
Rob Crittenden
parent
fca43ccd47
commit
2584e9be67
@@ -335,14 +335,17 @@ class permission_mod(LDAPUpdate):
|
||||
# when renaming permission, check if the target permission does not
|
||||
# exists already. Then, make changes to underlying ACI
|
||||
if 'rename' in options:
|
||||
try:
|
||||
new_dn = dn.replace(keys[-1], options['rename'], 1)
|
||||
(new_dn, attrs) = ldap.get_entry(
|
||||
new_dn, attrs_list, normalize=self.obj.normalize_dn
|
||||
)
|
||||
raise errors.DuplicateEntry()
|
||||
except errors.NotFound:
|
||||
pass # permission may be renamed, continue
|
||||
if options['rename']:
|
||||
try:
|
||||
new_dn = dn.replace(keys[-1].lower(), options['rename'], 1)
|
||||
(new_dn, attrs) = ldap.get_entry(
|
||||
new_dn, attrs_list, normalize=self.obj.normalize_dn
|
||||
)
|
||||
raise errors.DuplicateEntry()
|
||||
except errors.NotFound:
|
||||
pass # permission may be renamed, continue
|
||||
else:
|
||||
raise errors.ValidationError(name='rename',error=_('New name can not be empty'))
|
||||
|
||||
opts = copy.copy(options)
|
||||
for o in ['all', 'raw', 'rights', 'rename']:
|
||||
|
||||
Reference in New Issue
Block a user