Skip to content

Commit

Permalink
fix(CalDAV): set acls for DeletedCalendarObjectsCollection
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
  • Loading branch information
JohannesGGE committed Jan 17, 2024
1 parent 7ac9031 commit b454156
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 b454156

Please sign in to comment.