sharing/create: do not allow additional share with PathMapped for same User
This commit is contained in:
@@ -899,6 +899,12 @@ class BaseSharing:
|
|||||||
else:
|
else:
|
||||||
User = str(User)
|
User = str(User)
|
||||||
|
|
||||||
|
# lookup existing shares with requested PathMapped for same User
|
||||||
|
shares = self.database_list_sharing(ShareType=ShareType, PathMapped=PathMapped, User=User)
|
||||||
|
if len(shares) > 0:
|
||||||
|
logger.warning(api_info + ": share already exists with PathMapped=%r User=%r", PathMapped, User)
|
||||||
|
return httputils.CONFLICT
|
||||||
|
|
||||||
# check access Permissions
|
# check access Permissions
|
||||||
access = Access(self._rights, user, PathMapped, None) # PathMapped is mandatory
|
access = Access(self._rights, user, PathMapped, None) # PathMapped is mandatory
|
||||||
if not access.check("r") and "i" not in access.permissions:
|
if not access.check("r") and "i" not in access.permissions:
|
||||||
|
|||||||
Reference in New Issue
Block a user