fix(dav): ACLs for shared addressbooks

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2024-02-22 17:59:20 +01:00
parent 191b977fb9
commit e6df2a4981
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8
4 changed files with 9 additions and 4 deletions

@ -1 +1 @@
Subproject commit 9aabf1a490571ef88073d069222e9a232b772fc8
Subproject commit e8a165a3811f1b454694337aaff47c30888ca9fc

View file

@ -118,7 +118,7 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable, IMov
],
[
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'principal' => $this->getOwner(),
'protected' => true,
],
];
@ -129,6 +129,11 @@ class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable, IMov
'principal' => '{DAV:}authenticated',
'protected' => true,
];
$acl[] = [
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'protected' => true,
];
}
if (!$this->isShared()) {

View file

@ -265,7 +265,7 @@ class Backend {
'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
'protected' => true,
];
} elseif ($this->resourceType === 'calendar') {
} elseif (in_array($this->resourceType, ['calendar','addressbook'])) {
// Allow changing the properties of read only calendars,
// so users can change the visibility.
$acl[] = [

View file

@ -169,7 +169,7 @@ class AddressBookTest extends TestCase {
'protected' => true
], [
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'principal' => $hasOwnerSet ? 'user1' : 'user2',
'protected' => true
]];
if ($hasOwnerSet) {