diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-05-15 10:27:53 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2023-05-15 10:27:53 +0200 |
commit | 5d038a2dc1a1df3fbd9962abf04ec9f22d2baf4c (patch) | |
tree | 9c20d123fc08e1e35f271562b9a6b6e26db7360e /apps/dav | |
parent | 7fd453eb10d98a9ec1862f1506f6c1b82f38b54d (diff) | |
download | nextcloud-server-5d038a2dc1a1df3fbd9962abf04ec9f22d2baf4c.tar.gz nextcloud-server-5d038a2dc1a1df3fbd9962abf04ec9f22d2baf4c.zip |
fix(carddav): Mark system address book as read-only
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav')
-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; + }); + } } |