Skip to content

Commit 33509a9

Browse files
authored
Merge pull request #17184 from nextcloud/backport/17174/stable17
[stable17] properly mark birthday calendars as not shareable for now
2 parents 311b4ea + 45dea92 commit 33509a9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

apps/dav/lib/CalDAV/Calendar.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,11 @@ public function getPublishStatus() {
363363
return $this->caldavBackend->getPublishStatus($this);
364364
}
365365

366-
private function canWrite() {
366+
public function canWrite() {
367+
if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
368+
return false;
369+
}
370+
367371
if (isset($this->calendarInfo['{http://owncloud.org/ns}read-only'])) {
368372
return !$this->calendarInfo['{http://owncloud.org/ns}read-only'];
369373
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ public function propFind(PropFind $propFind, INode $node) {
126126
});
127127

128128
$propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function() use ($node) {
129-
return new AllowedSharingModes(!$node->isSubscription(), !$node->isSubscription());
129+
$canShare = (!$node->isSubscription() && $node->canWrite());
130+
$canPublish = (!$node->isSubscription() && $node->canWrite());
131+
132+
return new AllowedSharingModes($canShare, $canPublish);
130133
});
131134
}
132135
}

0 commit comments

Comments
 (0)