sharing: share-by-group: add share resolution for other methods beside propfind
This commit is contained in:
@@ -24,7 +24,7 @@ import re
|
||||
from http import client
|
||||
from urllib.parse import unquote, urlparse
|
||||
|
||||
from radicale import httputils, pathutils, storage, types
|
||||
from radicale import httputils, pathutils, sharing, storage, types
|
||||
from radicale.app import base as app_base
|
||||
from radicale.app.base import Access, ApplicationBase
|
||||
from radicale.log import logger
|
||||
@@ -73,7 +73,10 @@ class ApplicationPartMove(ApplicationBase):
|
||||
permissions_filter = None
|
||||
if self._sharing._enabled:
|
||||
# Sharing by token or map (if enabled)
|
||||
share = self._sharing.sharing_collection_resolver(path, user)
|
||||
user_lookup = user
|
||||
if self._rights._user_groups is not None and len(self._rights._user_groups) > 0:
|
||||
user_lookup += sharing.SHARING_SEPARATOR_GROUP + ','.join(self._rights._user_groups)
|
||||
share = self._sharing.sharing_collection_resolver(path, user_lookup)
|
||||
if share:
|
||||
# overwrite and run through extended permission check
|
||||
path = share['PathMapped']
|
||||
@@ -93,7 +96,10 @@ class ApplicationPartMove(ApplicationBase):
|
||||
to_path = to_path[len(base_prefix):]
|
||||
if self._sharing._enabled:
|
||||
# Sharing by token or map (if enabled)
|
||||
share = self._sharing.sharing_collection_resolver(to_path, to_user)
|
||||
to_user_lookup = to_user
|
||||
if self._rights._user_groups is not None and len(self._rights._user_groups) > 0:
|
||||
to_user_lookup += sharing.SHARING_SEPARATOR_GROUP + ','.join(self._rights._user_groups)
|
||||
share = self._sharing.sharing_collection_resolver(to_path, to_user_lookup)
|
||||
if share:
|
||||
# overwrite and run through extended permission check
|
||||
to_path = share['PathMapped']
|
||||
|
||||
Reference in New Issue
Block a user