From 68f05472843ce2a22a873528f8db0822c1dcb45b Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 8 May 2023 19:41:06 +0200 Subject: [PATCH] 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(+) diff --git a/apps/dav/lib/CardDAV/SystemAddressbook.php b/apps/dav/lib/CardDAV/SystemAddressbook.php index 502e353acb3..1c78e03162e 100644 --- a/apps/dav/lib/CardDAV/SystemAddressbook.php +++ b/apps/dav/lib/CardDAV/SystemAddressbook.php @@ -30,6 +30,7 @@ namespace OCA\DAV\CardDAV; use OCP\IConfig; use OCP\IL10N; use Sabre\CardDAV\Backend\BackendInterface; +use function array_filter; class SystemAddressbook extends AddressBook { /** @var IConfig */ @@ -50,4 +51,13 @@ class SystemAddressbook extends AddressBook { return parent::getChildren(); } + + public function getACL() { + return array_filter(parent::getACL(), function($acl) { + if (in_array($acl['privilege'], ['{DAV:}write', '{DAV:}all'], true)) { + return false; + } + return true; + }); + } } -- 2.39.5