summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/CardDavBackend.php
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-05-11 18:59:30 +0200
committerAnna Larch <anna@nextcloud.com>2023-05-11 18:59:30 +0200
commit5c2eb732f123c907201a2db36f12f0a269722ce7 (patch)
tree93f3ac458e66635c7546cf33c81080e00962d088 /apps/dav/lib/CardDAV/CardDavBackend.php
parent9d2d3d482bce004d134dd87d7b37c3dfb6513412 (diff)
downloadnextcloud-server-5c2eb732f123c907201a2db36f12f0a269722ce7.tar.gz
nextcloud-server-5c2eb732f123c907201a2db36f12f0a269722ce7.zip
fix(carddav): expose system address book
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav/lib/CardDAV/CardDavBackend.php')
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index 577d7282eae..5f5b8f1e65f 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -311,6 +311,11 @@ class CardDavBackend implements BackendInterface, SyncSupport {
'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0',
];
+ // system address books are always read only
+ if ($principal === 'principals/system/system') {
+ $addressBook['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only'] = true;
+ }
+
$this->addOwnerPrincipal($addressBook);
return $addressBook;