fix: add proper ACLs for trashbin proxys

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 b9c22da3c9
commit ad45d6b8a2
3 changed files with 49 additions and 3 deletions

View file

@ -94,7 +94,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

@ -125,9 +125,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

@ -36,6 +36,27 @@ class TrashbinHome implements IACL, ICollection, IProperties {
return $this->principalInfo['uri'];
}
#[\Override]
public function getACL(): array {
return [
[
'privilege' => '{DAV:}all',
'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,
],
];
}
public function createFile($name, $data = null) {
throw new Forbidden('Permission denied to create files in the trashbin');
}