diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php index 79128a72402ca..f622cb439952d 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObject.php @@ -105,7 +105,17 @@ public function getACL(): array { ], [ 'privilege' => '{DAV:}unbind', // For moving and deletion - 'principal' => '{DAV:}owner', + 'principal' => $this->getOwner(), + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}all', + 'principal' => $this->getOwner() . '/calendar-proxy-write', + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}read', + 'principal' => $this->getOwner() . '/calendar-proxy-read', 'protected' => true, ], ]; diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php index 01d806d006c1b..d853ed773f3d3 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php @@ -137,9 +137,24 @@ public function getACL(): array { ], [ 'privilege' => '{DAV:}unbind', - 'principal' => '{DAV:}owner', + 'principal' => $this->getOwner(), + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}read', + 'principal' => $this->getOwner() . '/calendar-proxy-write', + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}unbind', + 'principal' => $this->getOwner() . '/calendar-proxy-write', 'protected' => true, - ] + ], + [ + 'privilege' => '{DAV:}read', + 'principal' => $this->getOwner() . '/calendar-proxy-read', + 'protected' => true, + ], ]; } } diff --git a/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php b/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php index 568831c2b373f..bd4bdfda76375 100644 --- a/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php +++ b/apps/dav/lib/CalDAV/Trashbin/TrashbinHome.php @@ -37,6 +37,28 @@ public function getOwner(): string { return $this->principalInfo['uri']; } + #[\Override] + public function getACL(): array { + $ownerPrincipal = $this->principalInfo['uri']; + return [ + [ + 'privilege' => '{DAV:}all', + 'principal' => $ownerPrincipal, + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}all', + 'principal' => $ownerPrincipal . '/calendar-proxy-write', + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}read', + 'principal' => $ownerPrincipal . '/calendar-proxy-read', + 'protected' => true, + ], + ]; + } + #[\Override] public function createFile($name, $data = null) { throw new Forbidden('Permission denied to create files in the trashbin');