Skip to content

Commit 0638c55

Browse files
committed
fixup! Add ability to limit sharing to owner
1 parent 8d9b920 commit 0638c55

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/dav/lib/CalDAV/Publishing/PublishPlugin.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ public function propFind(PropFind $propFind, INode $node) {
130130
});
131131

132132
$propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function () use ($node) {
133+
$canShare = (!$node->isSubscription() && $node->canWrite());
134+
$canPublish = (!$node->isSubscription() && $node->canWrite());
135+
133136
if ($this->config->getAppValue('dav', 'limitAddressBookAndCalendarSharingToOwner', 'no') === 'yes') {
134-
$canShare = (!$node->isSubscription() && $node->getOwner() === $node->getPrincipalURI());
135-
$canPublish = (!$node->isSubscription() && $node->getOwner() === $node->getPrincipalURI());
136-
} else {
137-
$canShare = (!$node->isSubscription() && $node->canWrite());
138-
$canPublish = (!$node->isSubscription() && $node->canWrite());
137+
$canShare &= ($node->getOwner() === $node->getPrincipalURI());
138+
$canPublish &= ($node->getOwner() === $node->getPrincipalURI());
139139
}
140140

141-
return new AllowedSharingModes($canShare, $canPublish);
141+
return new AllowedSharingModes((bool)$canShare, (bool)$canPublish);
142142
});
143143
}
144144
}

0 commit comments

Comments
 (0)