From 5d038a2dc1a1df3fbd9962abf04ec9f22d2baf4c Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 15 May 2023 10:27:53 +0200 Subject: fix(carddav): Mark system address book as read-only Signed-off-by: Christoph Wurst --- apps/dav/lib/CardDAV/SystemAddressbook.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps/dav/lib/CardDAV') diff --git a/apps/dav/lib/CardDAV/SystemAddressbook.php b/apps/dav/lib/CardDAV/SystemAddressbook.php index 17900fd033e..41e473ede63 100644 --- a/apps/dav/lib/CardDAV/SystemAddressbook.php +++ b/apps/dav/lib/CardDAV/SystemAddressbook.php @@ -45,6 +45,7 @@ use Sabre\DAV\Exception\NotFound; use Sabre\DAV\ICollection; use Sabre\VObject\Component\VCard; use Sabre\VObject\Reader; +use function array_filter; use function array_unique; class SystemAddressbook extends AddressBook { @@ -296,4 +297,13 @@ class SystemAddressbook extends AddressBook { } throw new Forbidden(); } + + public function getACL() { + return array_filter(parent::getACL(), function($acl) { + if (in_array($acl['privilege'], ['{DAV:}write', '{DAV:}all'], true)) { + return false; + } + return true; + }); + } } -- cgit v1.2.3