]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix the system address book 12817/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 4 Dec 2018 12:33:03 +0000 (13:33 +0100)
committerBackportbot <backportbot-noreply@rullzer.com>
Tue, 4 Dec 2018 14:21:16 +0000 (14:21 +0000)
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 <roeland@famdouma.nl>
apps/dav/lib/CardDAV/AddressBook.php

index 30ce0a3253ca897c67420f842a0810c845e435f9..096f5c8b2a9a0c632ed8f29aa4eedc30404c28b6 100644 (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'];