From: Roeland Jago Douma Date: Tue, 4 Dec 2018 12:33:03 +0000 (+0100) Subject: Fix the system address book X-Git-Tag: v14.0.5RC1~60^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2bb278ecb02955674535b734a3c442c50fbd75a9;p=nextcloud-server.git Fix the system address book c23a66cda46d9a1f0ce8dc60a6c160809c87d9f6 broke the system address book. We now move the ACL rules for this special case up and all is good in the world again. Signed-off-by: Roeland Jago Douma --- diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php index 30ce0a3253c..096f5c8b2a9 100644 --- a/apps/dav/lib/CardDAV/AddressBook.php +++ b/apps/dav/lib/CardDAV/AddressBook.php @@ -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'];