sharing: map_list code improvement
This commit is contained in:
@@ -55,8 +55,8 @@ class ApplicationPartMkcalendar(ApplicationBase):
|
||||
"Bad MKCALENDAR request on %r: %s", path, e, exc_info=True)
|
||||
return httputils.BAD_REQUEST
|
||||
if self._sharing._enabled:
|
||||
# check for shared collections (all users / active or inactive)
|
||||
collections_share_map = self._sharing.sharing_collection_map_list(user=None, active=False)
|
||||
# check for shared collections (all)
|
||||
collections_share_map = self._sharing.sharing_collection_map_list()
|
||||
if collections_share_map:
|
||||
for share in collections_share_map:
|
||||
if share['PathOrToken'] == path:
|
||||
|
||||
@@ -62,8 +62,8 @@ class ApplicationPartMkcol(ApplicationBase):
|
||||
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 (all users, active or inactive)
|
||||
collections_share_map = self._sharing.sharing_collection_map_list(user=None, active=False)
|
||||
# check for shared collections (all)
|
||||
collections_share_map = self._sharing.sharing_collection_map_list()
|
||||
if collections_share_map:
|
||||
for share in collections_share_map:
|
||||
if share['PathOrToken'] == path:
|
||||
|
||||
@@ -466,8 +466,8 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||
if http_depth == "1":
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("TRACE/PROPFIND: get shared collections")
|
||||
# check for shared collections
|
||||
collections_share_map = self._sharing.sharing_collection_map_list(user)
|
||||
# check for shared collections related to user, Enabled and not Hidden
|
||||
collections_share_map = self._sharing.sharing_collection_map_list(User=user, Enabled=True, Hidden=False)
|
||||
if collections_share_map:
|
||||
for share in collections_share_map:
|
||||
c_share = share['PathOrToken']
|
||||
|
||||
Reference in New Issue
Block a user