]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(carddav): Mark system address book as read-only 38247/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 15 May 2023 08:27:53 +0000 (10:27 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 15 May 2023 08:27:53 +0000 (10:27 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
apps/dav/lib/CardDAV/SystemAddressbook.php

index 17900fd033e5fa342b3e191e21447d068f171424..41e473ede6367f19e8380bc92656495ffd7ab241 100644 (file)
@@ -45,6 +45,7 @@ use Sabre\DAV\Exception\NotFound;
 use Sabre\DAV\ICollection;
 use Sabre\VObject\Component\VCard;
 use Sabre\VObject\Reader;
+use function array_filter;
 use function array_unique;
 
 class SystemAddressbook extends AddressBook {
@@ -296,4 +297,13 @@ class SystemAddressbook extends AddressBook {
                }
                throw new Forbidden();
        }
+
+       public function getACL() {
+               return array_filter(parent::getACL(), function($acl) {
+                       if (in_array($acl['privilege'], ['{DAV:}write', '{DAV:}all'], true)) {
+                               return false;
+                       }
+                       return true;
+               });
+       }
 }