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:
parent
ab28d65343
commit
08a4c792b1
4 changed files with 21 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue