From b0a3782a07be48c08252555bbc22c9480e9bea13 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Tue, 17 Sep 2019 11:05:55 +0200 Subject: [PATCH] properly mark birthday calendars as not shareable for now Signed-off-by: Georg Ehrke --- apps/dav/lib/CalDAV/Calendar.php | 6 +++++- apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 38def19af1da0..b875d42e0a396 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -363,7 +363,11 @@ public function getPublishStatus() { return $this->caldavBackend->getPublishStatus($this); } - private function canWrite() { + public function canWrite() { + if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) { + return false; + } + if (isset($this->calendarInfo['{http://owncloud.org/ns}read-only'])) { return !$this->calendarInfo['{http://owncloud.org/ns}read-only']; } diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 53059818039f3..fc276fb25ca41 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -126,7 +126,10 @@ public function propFind(PropFind $propFind, INode $node) { }); $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function() use ($node) { - return new AllowedSharingModes(!$node->isSubscription(), !$node->isSubscription()); + $canShare = (!$node->isSubscription() && $node->canWrite()); + $canPublish = (!$node->isSubscription() && $node->canWrite()); + + return new AllowedSharingModes($canShare, $canPublish); }); } }