summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/AddressBook.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-12-04 13:33:03 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-12-04 13:33:03 +0100
commit29eff7b1227d3b36d009b1b2bd3e5d146109ba1e (patch)
treed3143086498a9e98e1d7e7d38a8493475784e912 /apps/dav/lib/CardDAV/AddressBook.php
parent897d0f72d3875b7230b47e667ad5a3d0e26987f8 (diff)
downloadnextcloud-server-29eff7b1227d3b36d009b1b2bd3e5d146109ba1e.tar.gz
nextcloud-server-29eff7b1227d3b36d009b1b2bd3e5d146109ba1e.zip
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 <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/CardDAV/AddressBook.php')
-rw-r--r--apps/dav/lib/CardDAV/AddressBook.php15
1 files changed, 8 insertions, 7 deletions
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'];