diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-05-08 19:41:06 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-05-15 10:32:49 +0200 |
commit | 68f05472843ce2a22a873528f8db0822c1dcb45b (patch) | |
tree | cf775951d0134cad4b20ac26f85b028b91b0c4f0 | |
parent | e0f9137b8adcb9780ada9c07b07d7a6c0fc2fbbd (diff) | |
download | nextcloud-server-68f05472843ce2a22a873528f8db0822c1dcb45b.tar.gz nextcloud-server-68f05472843ce2a22a873528f8db0822c1dcb45b.zip |
fix(carddav): Mark system address book as read-only
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | apps/dav/lib/CardDAV/SystemAddressbook.php | 10 |
1 files changed, 10 insertions, 0 deletions
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; + }); + } } |