From 6d520f3b429f8c71fd94ae81cd38d47a219951c6 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Sun, 15 Mar 2026 07:04:50 +0100 Subject: [PATCH] sharing/create: do not allow additional share with PathMapped for same User --- radicale/sharing/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radicale/sharing/__init__.py b/radicale/sharing/__init__.py index a81e048a..6a6ee954 100644 --- a/radicale/sharing/__init__.py +++ b/radicale/sharing/__init__.py @@ -899,6 +899,12 @@ class BaseSharing: else: 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 access = Access(self._rights, user, PathMapped, None) # PathMapped is mandatory if not access.check("r") and "i" not in access.permissions: