summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-05-08 19:41:06 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-05-15 10:35:08 +0200
commitd0f42b36a19e3c1d24e7955d33d4f796b7690e53 (patch)
treea519c0769ebbe78ce2bdb5f083a0673a977abf81 /apps
parentaa86a3d2b359ea5951477715dddc3301f02c72fe (diff)
downloadnextcloud-server-d0f42b36a19e3c1d24e7955d33d4f796b7690e53.tar.gz
nextcloud-server-d0f42b36a19e3c1d24e7955d33d4f796b7690e53.zip
fix(carddav): Mark system address book as read-only
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CardDAV/SystemAddressbook.php10
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;
+ });
+ }
}