mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: add proper ACLs for trashbin proxys
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
This commit is contained in:
parent
66a156ac3e
commit
0d1349b0ad
3 changed files with 50 additions and 3 deletions
|
|
@ -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,
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue