aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-09-18 12:48:42 +0200
committerGitHub <noreply@github.com>2019-09-18 12:48:42 +0200
commit33509a9834b198d3950c67e34d03b9385fc7bddb (patch)
treef85ffab65b7e5e82c6f91a2e1177f3e4de7d41df
parent311b4ea2619b824b49e3116900cb2dca2f89ab58 (diff)
parent45dea9245ee82f6843f7cc2f28dd95f6a844e29e (diff)
downloadnextcloud-server-33509a9834b198d3950c67e34d03b9385fc7bddb.tar.gz
nextcloud-server-33509a9834b198d3950c67e34d03b9385fc7bddb.zip
Merge pull request #17184 from nextcloud/backport/17174/stable17
[stable17] properly mark birthday calendars as not shareable for now
-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);
});
}
}