diff options
author | Johannes Merkel <mail@johannesgge.de> | 2024-01-03 15:49:53 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-01-18 08:39:24 +0100 |
commit | a509c856628498345c264d6127ca77d440e6824f (patch) | |
tree | af210fef28cccb8078db3b1649349920da2d2680 /apps/dav | |
parent | 0b9e2fa4bc7327b72ce5554c1663a64aa6467afd (diff) | |
download | nextcloud-server-a509c856628498345c264d6127ca77d440e6824f.tar.gz nextcloud-server-a509c856628498345c264d6127ca77d440e6824f.zip |
fix(CalDAV): set acls for DeletedCalendarObjectsCollection
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php b/apps/dav/lib/CalDAV/Trashbin/DeletedCalendarObjectsCollection.php index f7f0bd7b512..5362b45ee7b 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\BadRequest; 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 @@ class DeletedCalendarObjectsCollection implements ICalendarObjectContainer { [$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, + ] + ]; + } } |