];
}
+ if (!$this->isShared()) {
+ return $acl;
+ }
+
if ($this->getOwner() !== parent::getOwner()) {
$acl[] = [
'privilege' => '{DAV:}read',
}
$acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
-
- if (!$this->isShared()) {
- return $acl;
- }
-
$allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/public'];
return array_filter($acl, function($rule) use ($allowedPrincipals) {
- return in_array($rule['principal'], $allowedPrincipals);
+ return \in_array($rule['principal'], $allowedPrincipals, true);
});
}
'privilege' => '{DAV:}read',
'principal' => $this->getOwner(),
'protected' => true,
- ]];
- $acl[] = [
+ ],[
'privilege' => '{DAV:}write',
'principal' => $this->getOwner(),
'protected' => true,
- ];
+ ]
+ ];
+
+ if (!$this->isShared()) {
+ return $acl;
+ }
+
if ($this->getOwner() !== parent::getOwner()) {
$acl[] = [
'privilege' => '{DAV:}read',
];
}
- if ($this->isShared()) {
- return $acl;
- }
-
- return $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl);
+ $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl);
+ $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system'];
+ return array_filter($acl, function($rule) use ($allowedPrincipals) {
+ return \in_array($rule['principal'], $allowedPrincipals, true);
+ });
}
public function getChildACL() {