aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2019-09-17 11:05:55 +0200
committerGeorg Ehrke <developer@georgehrke.com>2019-09-17 12:21:26 +0200
commitb0a3782a07be48c08252555bbc22c9480e9bea13 (patch)
tree1b39c264f2d19c47d87884838804c541fd55ba07 /apps/dav/lib/CalDAV
parent7149ed74c1f7aaa022d349f892c4727b614b8ec6 (diff)
downloadnextcloud-server-b0a3782a07be48c08252555bbc22c9480e9bea13.tar.gz
nextcloud-server-b0a3782a07be48c08252555bbc22c9480e9bea13.zip
properly mark birthday calendars as not shareable for now
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php6
-rw-r--r--apps/dav/lib/CalDAV/Publishing/PublishPlugin.php5
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 38def19af1d..b875d42e0a3 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -363,7 +363,11 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
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 53059818039..fc276fb25ca 100644
--- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
+++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php
@@ -126,7 +126,10 @@ class PublishPlugin extends ServerPlugin {
});
$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);
});
}
}