Merge pull request #12818 from nextcloud/backport/12813/stable13

[stable13] Fix the system address book
This commit is contained in:
Christoph Wurst 2018-12-05 08:17:40 +01:00 committed by GitHub
commit 0d602760df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -112,6 +112,14 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable {
]
];
if ($this->getOwner() === 'principals/system/system') {
$acl[] = [
'privilege' => '{DAV:}read',
'principal' => '{DAV:}authenticated',
'protected' => true,
];
}
if (!$this->isShared()) {
return $acl;
}
@ -130,13 +138,6 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable {
];
}
}
if ($this->getOwner() === 'principals/system/system') {
$acl[] = [
'privilege' => '{DAV:}read',
'principal' => '{DAV:}authenticated',
'protected' => true,
];
}
$acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl);
$allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system'];