sharing/map: catch collection path with missing trailing /
This commit is contained in:
@@ -647,9 +647,19 @@ class BaseSharing:
|
|||||||
if result:
|
if result:
|
||||||
result['PathMapped'] = path.replace(parent_path, result['PathMapped'])
|
result['PathMapped'] = path.replace(parent_path, result['PathMapped'])
|
||||||
logger.trace("sharing/map/resolver: PathMapped=%r Permissions=%r by parent_path=%r", result['PathMapped'], result['Permissions'], parent_path)
|
logger.trace("sharing/map/resolver: PathMapped=%r Permissions=%r by parent_path=%r", result['PathMapped'], result['Permissions'], parent_path)
|
||||||
else:
|
|
||||||
logger.trace("sharing/map/resolver: not found")
|
if not result and not path.endswith("/"):
|
||||||
return None
|
# assume collection path with missing trailing /
|
||||||
|
path_with_trailing_slash = path + "/"
|
||||||
|
logger.trace("sharing/map/resolver: check path having '/' appended: %r", path_with_trailing_slash)
|
||||||
|
result = self.database_get_sharing(
|
||||||
|
ShareType="map",
|
||||||
|
PathOrToken=path_with_trailing_slash,
|
||||||
|
OnlyEnabled=False,
|
||||||
|
User=user)
|
||||||
|
if result:
|
||||||
|
path = path_with_trailing_slash
|
||||||
|
logger.trace("sharing/map/resolver: PathMapped=%r Permissions=%r by path_with_trailing_slash=%r", result['PathMapped'], result['Permissions'], path_with_trailing_slash)
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
if result['EnabledByOwner'] is not True:
|
if result['EnabledByOwner'] is not True:
|
||||||
@@ -667,6 +677,7 @@ class BaseSharing:
|
|||||||
logger.info("sharing/%s: resolved path %r->%r, user %r->%r, Permissions=%r Conversion=%r", "map", result['PathOrToken'], result['PathMapped'], user, result['Owner'], result['Permissions'], result['Conversion'])
|
logger.info("sharing/%s: resolved path %r->%r, user %r->%r, Permissions=%r Conversion=%r", "map", result['PathOrToken'], result['PathMapped'], user, result['Owner'], result['Permissions'], result['Conversion'])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
logger.trace("sharing/map/resolver: not found")
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
logger.trace("sharing/map: not active")
|
logger.trace("sharing/map: not active")
|
||||||
|
|||||||
Reference in New Issue
Block a user