fix(dav): ACLs for shared addressbooks

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/44376/head
Christoph Wurst 2 years ago
parent 03f269829f
commit b6e1685683
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 7
      apps/dav/lib/CardDAV/AddressBook.php
  2. 2
      apps/dav/lib/DAV/Sharing/Backend.php
  3. 2
      apps/dav/tests/unit/CardDAV/AddressBookTest.php

@ -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()) {

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

@ -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) {

Loading…
Cancel
Save