1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-07 18:30:54 +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 f407915227
commit 0f355114ae
4 changed files with 14 additions and 1 deletions

View file

@ -68,7 +68,10 @@ class ApplicationPartDelete(ApplicationBase):
# ETag precondition not verified, do not delete item
return httputils.PRECONDITION_FAILED
if isinstance(item, storage.BaseCollection):
xml_answer = xml_delete(base_prefix, path, item)
if self._permit_delete_collection:
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