Skip to content

Commit

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

[stable28] fix(CalDAV): set acls for DeletedCalendarObjectsCollection
  • Loading branch information
blizzz committed Jan 18, 2024
2 parents 0b9e2fa + a509c85 commit 0f3af00
Showing 1 changed file with 24 additions and 1 deletion.
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 0f3af00

Please sign in to comment.