mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
permission plugin: Ensure ipapermlocation (subtree) always exists
This commit is contained in:
committed by
Martin Kosek
parent
53caa7aca2
commit
7fc35ced1d
@@ -623,6 +623,16 @@ class permission(baseldap.LDAPObject):
|
||||
name='ipapermtargetfilter',
|
||||
error=_('Bad search filter'))
|
||||
|
||||
# Ensure location exists
|
||||
if entry.get('ipapermlocation'):
|
||||
location = DN(entry.single_value['ipapermlocation'])
|
||||
try:
|
||||
ldap.get_entry(location, attrs_list=[])
|
||||
except errors.NotFound:
|
||||
raise errors.ValidationError(
|
||||
name='ipapermlocation',
|
||||
error=_('Entry %s does not exist') % location)
|
||||
|
||||
# Ensure there's something in the ACI's filter
|
||||
needed_attrs = (
|
||||
'ipapermtarget', 'ipapermtargetfilter', 'ipapermallowedattr')
|
||||
|
||||
Reference in New Issue
Block a user