diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-05-15 14:01:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 14:01:41 +0200 |
commit | b9026acf3ffbf8f7ea060761b09bb8ec8b10e62f (patch) | |
tree | ecc2b17c8bfd647597bab57613fd90a6d2e8e83b /apps | |
parent | 24690a3a484563e754ee5435db3ff92f2269204e (diff) | |
parent | 5d038a2dc1a1df3fbd9962abf04ec9f22d2baf4c (diff) | |
download | nextcloud-server-b9026acf3ffbf8f7ea060761b09bb8ec8b10e62f.tar.gz nextcloud-server-b9026acf3ffbf8f7ea060761b09bb8ec8b10e62f.zip |
Merge pull request #38247 from nextcloud/fix/read-only-system-addres-book-acls
fix(carddav): Mark system address book as read-only
Diffstat (limited to 'apps')
-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 17900fd033e..41e473ede63 100644 --- a/apps/dav/lib/CardDAV/SystemAddressbook.php +++ b/apps/dav/lib/CardDAV/SystemAddressbook.php @@ -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; + }); + } } |