];
}
- if ($this->isShared()) {
+ $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
+
+ if (!$this->isShared()) {
return $acl;
}
- return $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
+ $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/public'];
+ return array_filter($acl, function($rule) use ($allowedPrincipals) {
+ return in_array($rule['principal'], $allowedPrincipals);
+ });
}
public function getChildACL() {
]);
$backend->expects($this->any())->method('getCalendarObject')
->willReturn($calObject2)->with(666, 'event-2');
+ $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1);
$calendarInfo = [
'principaluri' => 'user2',
]);
$backend->expects($this->any())->method('getCalendarObject')
->willReturn($calObject1)->with(666, 'event-1');
+ $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1);
$calendarInfo = [
'{http://owncloud.org/ns}owner-principal' => $isShared ? 'user1' : 'user2',
]);
$backend->expects($this->any())->method('getCalendarObject')
->willReturn($calObject2)->with(666, 'event-2');
+ $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1);
$calendarInfo = [
'{http://owncloud.org/ns}owner-principal' => 'user2',
]);
$backend->expects($this->any())->method('getCalendarObject')
->willReturn($calObject1)->with(666, 'event-1');
+ $backend->expects($this->any())->method('applyShareAcl')->willReturnArgument(1);
$calendarInfo = [
'{http://owncloud.org/ns}owner-principal' => 'user1',