fix(carddav): Mark system address book as read-only

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/38247/head
Christoph Wurst 2023-05-15 10:27:53 +07:00
parent 7fd453eb10
commit 5d038a2dc1
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
1 changed files with 10 additions and 0 deletions

@ -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;
});
}
}