sharing: add support for put

This commit is contained in:
Peter Bieringer
2026-02-24 06:45:16 +01:00
parent 51994bed00
commit 1451be9ded

View File

@@ -182,6 +182,15 @@ class ApplicationPartPut(ApplicationBase):
path: str, user: str, remote_host: str, remote_useragent: str) -> types.WSGIResponse:
"""Manage PUT request."""
permissions_filter = None
if self._sharing._enabled:
# Sharing by token or map (if enabled)
sharing = self._sharing.sharing_collection_resolver(path, user)
if sharing:
# overwrite and run through extended permission check
path = sharing['PathMapped']
user = sharing['Owner']
permissions_filter = sharing['Permissions']
access = Access(self._rights, user, path, permissions_filter)
access = Access(self._rights, user, path, permissions_filter)
if not access.check("w"):
return httputils.NOT_ALLOWED