Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix(dav): ACLs for shared addressbooks #44377

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 423 files
7 changes: 6 additions & 1 deletion apps/dav/lib/CardDAV/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function getACL() {
],
[
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'principal' => $this->getOwner(),
'protected' => true,
],
];
Expand All @@ -129,6 +129,11 @@ public function getACL() {
'principal' => '{DAV:}authenticated',
'protected' => true,
];
$acl[] = [
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'protected' => true,
];
}

if (!$this->isShared()) {
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/DAV/Sharing/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function applyShareAcl(int $resourceId, array $acl): array {
'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[] = [
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/tests/unit/CardDAV/AddressBookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function testAcl($expectsWrite, $readOnlyValue, $hasOwnerSet): void {
'protected' => true
], [
'privilege' => '{DAV:}write-properties',
'principal' => '{DAV:}authenticated',
'principal' => $hasOwnerSet ? 'user1' : 'user2',
'protected' => true
]];
if ($hasOwnerSet) {
Expand Down
Loading