Skip to content

Commit

Permalink
Merge pull request #42909 from nextcloud/fix/caldav/update-acls-delet…
Browse files Browse the repository at this point in the history
…edcalendarobjectscollection-stable25

[stable25] fix(CalDAV): set acls for DeletedCalendarObjectsCollection
  • Loading branch information
ChristophWurst authored Jan 22, 2024
2 parents 45a16bf + fd6dff8 commit 3fd8b05
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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,
]
];
}
}

0 comments on commit 3fd8b05

Please sign in to comment.