aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-03-21 15:55:07 +0100
committerGitHub <noreply@github.com>2024-03-21 15:55:07 +0100
commit5d84d652d6edac45981154e4fe25703c33c360f2 (patch)
treef64129c3fcf7420141e831088a6cbac5d5c4c496
parent0bd0b5c22fa1719c00d7e2fc6cf8235ac671c0b6 (diff)
parent08a7937af549f9be419ef442c4df700b37ba0c90 (diff)
downloadnextcloud-server-5d84d652d6edac45981154e4fe25703c33c360f2.tar.gz
nextcloud-server-5d84d652d6edac45981154e4fe25703c33c360f2.zip
Merge pull request #44378 from nextcloud/backport/44376/stable27
[stable27] fix(dav): ACLs for shared addressbooks
-rw-r--r--apps/dav/lib/CardDAV/AddressBook.php7
-rw-r--r--apps/dav/lib/DAV/Sharing/Backend.php2
-rw-r--r--apps/dav/tests/unit/CardDAV/AddressBookTest.php2
3 files changed, 8 insertions, 3 deletions
diff --git a/apps/dav/lib/CardDAV/AddressBook.php b/apps/dav/lib/CardDAV/AddressBook.php
index 468961b958e..4f589031f06 100644
--- a/apps/dav/lib/CardDAV/AddressBook.php
+++ b/apps/dav/lib/CardDAV/AddressBook.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()) {
diff --git a/apps/dav/lib/DAV/Sharing/Backend.php b/apps/dav/lib/DAV/Sharing/Backend.php
index 74b34b81b22..268087c6fbc 100644
--- a/apps/dav/lib/DAV/Sharing/Backend.php
+++ b/apps/dav/lib/DAV/Sharing/Backend.php
@@ -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[] = [
diff --git a/apps/dav/tests/unit/CardDAV/AddressBookTest.php b/apps/dav/tests/unit/CardDAV/AddressBookTest.php
index 06d81662a42..2bb60663f41 100644
--- a/apps/dav/tests/unit/CardDAV/AddressBookTest.php
+++ b/apps/dav/tests/unit/CardDAV/AddressBookTest.php
@@ -170,7 +170,7 @@ class AddressBookTest extends TestCase {
'protected' => true
], [
'privilege' => '{DAV:}write-properties',
- 'principal' => '{DAV:}authenticated',
+ 'principal' => $hasOwnerSet ? 'user1' : 'user2',
'protected' => true
]];
if ($hasOwnerSet) {