add support for dedicated forbid/permit permission
This commit is contained in:
@@ -73,18 +73,22 @@ class ApplicationPartDelete(ApplicationBase):
|
|||||||
hook_notification_item_list = []
|
hook_notification_item_list = []
|
||||||
if isinstance(item, storage.BaseCollection):
|
if isinstance(item, storage.BaseCollection):
|
||||||
if self._permit_delete_collection:
|
if self._permit_delete_collection:
|
||||||
for i in item.get_all():
|
if access.check("d", item):
|
||||||
hook_notification_item_list.append(
|
logger.info("delete of collection is permitted by config/option [rights] permit_delete_collection but explicit forbidden by permission 'd': %s", path)
|
||||||
HookNotificationItem(
|
return httputils.NOT_ALLOWED
|
||||||
HookNotificationItemTypes.DELETE,
|
|
||||||
access.path,
|
|
||||||
i.uid
|
|
||||||
)
|
|
||||||
)
|
|
||||||
xml_answer = xml_delete(base_prefix, path, item)
|
|
||||||
else:
|
else:
|
||||||
logger.info("delete of collection is prevented by config/option [rights] permit_delete_collection: %s", path)
|
if not access.check("D", item):
|
||||||
return httputils.NOT_ALLOWED
|
logger.info("delete of collection is prevented by config/option [rights] permit_delete_collection and not explicit allowed by permission 'D': %s", path)
|
||||||
|
return httputils.NOT_ALLOWED
|
||||||
|
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)
|
||||||
else:
|
else:
|
||||||
assert item.collection is not None
|
assert item.collection is not None
|
||||||
assert item.href is not None
|
assert item.href is not None
|
||||||
|
|||||||
Reference in New Issue
Block a user