fix: add proper ACLs for trashbin proxys

Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
This commit is contained in:
Hamza 2026-05-05 11:43:17 +02:00
parent 66a156ac3e
commit 0d1349b0ad
3 changed files with 50 additions and 3 deletions

View file

@ -105,7 +105,17 @@ class DeletedCalendarObject implements IACL, ICalendarObject, IRestorable {
],
[
'privilege' => '{DAV:}unbind', // For moving and deletion
'principal' => '{DAV:}owner',
'principal' => $this->getOwner(),
'protected' => true,
],
[
'privilege' => '{DAV:}all',
'principal' => $this->getOwner() . '/calendar-proxy-write',
'protected' => true,
],
[
'privilege' => '{DAV:}read',
'principal' => $this->getOwner() . '/calendar-proxy-read',
'protected' => true,
],
];

View file

@ -137,9 +137,24 @@ class DeletedCalendarObjectsCollection implements ICalendarObjectContainer, IACL
],
[
'privilege' => '{DAV:}unbind',
'principal' => '{DAV:}owner',
'principal' => $this->getOwner(),
'protected' => true,
]
],
[
'privilege' => '{DAV:}read',
'principal' => $this->getOwner() . '/calendar-proxy-write',
'protected' => true,
],
[
'privilege' => '{DAV:}unbind',
'principal' => $this->getOwner() . '/calendar-proxy-write',
'protected' => true,
],
[
'privilege' => '{DAV:}read',
'principal' => $this->getOwner() . '/calendar-proxy-read',
'protected' => true,
],
];
}
}

View file

@ -37,6 +37,28 @@ class TrashbinHome implements IACL, ICollection, IProperties {
return $this->principalInfo['uri'];
}
#[\Override]
public function getACL(): array {
$ownerPrincipal = $this->principalInfo['uri'];
return [
[
'privilege' => '{DAV:}all',
'principal' => $ownerPrincipal,
'protected' => true,
],
[
'privilege' => '{DAV:}all',
'principal' => $ownerPrincipal . '/calendar-proxy-write',
'protected' => true,
],
[
'privilege' => '{DAV:}read',
'principal' => $ownerPrincipal . '/calendar-proxy-read',
'protected' => true,
],
];
}
#[\Override]
public function createFile($name, $data = null) {
throw new Forbidden('Permission denied to create files in the trashbin');