1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-10 18:40:53 +00:00

add option for global permit of delete of collection (default: True to avoid breaking change)

This commit is contained in:
Peter Bieringer 2024-03-09 06:43:39 +01:00
parent ab28d65343
commit 08a4c792b1
4 changed files with 21 additions and 8 deletions

View file

@ -70,15 +70,18 @@ class ApplicationPartDelete(ApplicationBase):
return httputils.PRECONDITION_FAILED
hook_notification_item_list = []
if isinstance(item, storage.BaseCollection):
for i in item.get_all():
hook_notification_item_list.append(
HookNotificationItem(
HookNotificationItemTypes.DELETE,
access.path,
i.uid
if self._permit_delete_collection:
for i in item.get_all():
hook_notification_item_list.append(
HookNotificationItem(
HookNotificationItemTypes.DELETE,
access.path,
i.uid
)
)
)
xml_answer = xml_delete(base_prefix, path, item)
xml_answer = xml_delete(base_prefix, path, item)
else:
return httputils.NOT_ALLOWED
else:
assert item.collection is not None
assert item.href is not None