Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-09-17 19:03:21 +0300
committerGitHub <noreply@github.com>2019-09-17 19:03:21 +0300
commit85610d9b99602330664c3649501e740588a00e05 (patch)
tree05c9d74360f9c957f0e6972ab322d70594303ede /apps
parent89880fb2c4cb4f7bf5dd51a6983ddebcab01ead9 (diff)
parentb0a3782a07be48c08252555bbc22c9480e9bea13 (diff)
Merge pull request #17174 from nextcloud/bugfix/noid/properly_mark_birthday_calendars_as_not_sharable
properly mark birthday calendars as not shareable for now
Diffstat (limited to 'apps')
-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);
});
}
}