From b454156f57b4bbbdbff9636b5e060a227102fb9c Mon Sep 17 00:00:00 2001 From: Johannes Merkel Date: Wed, 3 Jan 2024 15:49:53 +0100 Subject: [PATCH] fix(CalDAV): set acls for DeletedCalendarObjectsCollection Signed-off-by: Johannes Merkel --- .../DeletedCalendarObjectsCollection.php | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php index f7f0bd7b5127d..5362b45ee7b13 100644 --- a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php +++ b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php @@ -31,11 +31,15 @@ use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\NotImplemented; +use Sabre\DAVACL\ACLTrait; +use Sabre\DAVACL\IACL; use function array_map; use function implode; use function preg_match; -class DeletedCalendarObjectsCollection implements ICalendarObjectContainer { +class DeletedCalendarObjectsCollection implements ICalendarObjectContainer, IACL { + use ACLTrait; + public const NAME = 'objects'; /** @var CalDavBackend */ @@ -129,4 +133,23 @@ private function getRelativeObjectPath(array $calendarInfo): string { [$calendarInfo['id'], 'ics'], ); } + + public function getOwner() { + return $this->principalInfo['uri']; + } + + public function getACL(): array { + return [ + [ + 'privilege' => '{DAV:}read', + 'principal' => $this->getOwner(), + 'protected' => true, + ], + [ + 'privilege' => '{DAV:}unbind', + 'principal' => '{DAV:}owner', + 'protected' => true, + ] + ]; + } }