mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Disallow deletion of global password policy.
ticket 1936
This commit is contained in:
committed by
Martin Kosek
parent
89b869d2c2
commit
c0879cd00b
@@ -366,6 +366,14 @@ class pwpolicy_del(LDAPDelete):
|
||||
attribute=True, required=True, multivalue=True
|
||||
)
|
||||
|
||||
def pre_callback(self, ldap, dn, *keys, **options):
|
||||
if dn.lower() == global_policy_dn.lower():
|
||||
raise errors.ValidationError(
|
||||
name='group',
|
||||
error=_('cannot delete global password policy')
|
||||
)
|
||||
return dn
|
||||
|
||||
def post_callback(self, ldap, dn, *keys, **options):
|
||||
try:
|
||||
self.api.Command.cosentry_del(keys[-1])
|
||||
|
||||
Reference in New Issue
Block a user