mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #38247 from nextcloud/fix/read-only-system-addres-book-acls
fix(carddav): Mark system address book as read-only
This commit is contained in:
commit
b9026acf3f
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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue