mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
fix(carddav): Mark system address book as read-only
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
038c9f2912
commit
4e7f575f91
1 changed files with 10 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ namespace OCA\DAV\CardDAV;
|
|||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use Sabre\CardDAV\Backend\BackendInterface;
|
||||
use function array_filter;
|
||||
|
||||
class SystemAddressbook extends AddressBook {
|
||||
/** @var IConfig */
|
||||
|
|
@ -50,4 +51,13 @@ class SystemAddressbook extends AddressBook {
|
|||
|
||||
return parent::getChildren();
|
||||
}
|
||||
|
||||
public function getACL() {
|
||||
return array_filter(parent::getACL(), function($acl) {
|
||||
if (in_array($acl['privilege'], ['{DAV:}write', '{DAV:}all'], true)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue