Skip to content

Commit 476fd81

Browse files
fix(dav): ACLs for shared addressbooks
Signed-off-by: Christoph Wurst <[email protected]>
1 parent 03f2698 commit 476fd81

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/dav/lib/CardDAV/AddressBook.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function getACL() {
118118
],
119119
[
120120
'privilege' => '{DAV:}write-properties',
121-
'principal' => '{DAV:}authenticated',
121+
'principal' => $this->getOwner(),
122122
'protected' => true,
123123
],
124124
];
@@ -129,6 +129,11 @@ public function getACL() {
129129
'principal' => '{DAV:}authenticated',
130130
'protected' => true,
131131
];
132+
$acl[] = [
133+
'privilege' => '{DAV:}write-properties',
134+
'principal' => '{DAV:}authenticated',
135+
'protected' => true,
136+
];
132137
}
133138

134139
if (!$this->isShared()) {

apps/dav/lib/DAV/Sharing/Backend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function applyShareAcl(array $shares, array $acl): array {
214214
'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
215215
'protected' => true,
216216
];
217-
} elseif ($this->service->getResourceType() === 'calendar') {
217+
} elseif (in_array($this->service->getResourceType(), ['calendar','addressbook'])) {
218218
// Allow changing the properties of read only calendars,
219219
// so users can change the visibility.
220220
$acl[] = [

0 commit comments

Comments
 (0)