sharing: add hook for simple calls

This commit is contained in:
Peter Bieringer
2026-02-24 06:38:46 +01:00
parent 8562fcdcd7
commit 5b980fbc49
5 changed files with 47 additions and 0 deletions

View File

@@ -61,6 +61,13 @@ class ApplicationPartMkcol(ApplicationBase):
if not props.get("tag") and "W" not in permissions:
logger.warning("MKCOL request %r (type:%s): %s", path, collection_type, "rejected because of missing rights 'W'")
return httputils.NOT_ALLOWED
if self._sharing._enabled:
# check for shared collections (active or inactive)
collections_shared_map = self._sharing.sharing_collection_map_list(user, active=False)
if collections_shared_map:
for sharing in collections_shared_map:
if sharing['PathOrToken'] == path:
return httputils.CONFLICT
with self._storage.acquire_lock("w", user, path=path, request="MKCOL"):
item = next(iter(self._storage.discover(path)), None)
if item: