summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2023-05-17 13:13:40 +0200
committerGitHub <noreply@github.com>2023-05-17 13:13:40 +0200
commitfed6aa0329cc6f9217495810770a05da35179e90 (patch)
tree2fbcd0ce0c5227e28628deb81dacc50902e60080
parent413611acac7a3f96921155af3da146b674bd0053 (diff)
parent68f05472843ce2a22a873528f8db0822c1dcb45b (diff)
downloadnextcloud-server-fed6aa0329cc6f9217495810770a05da35179e90.tar.gz
nextcloud-server-fed6aa0329cc6f9217495810770a05da35179e90.zip
Merge pull request #38248 from nextcloud/fix/read-only-system-addres-book-acls-stable26
[stable26] fix(carddav): Mark system address book as read-only
-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;
+ });
+ }
}