]> source.dussan.org Git - nextcloud-server.git/commitdiff
properly mark birthday calendars as not shareable for now 17174/head
authorGeorg Ehrke <developer@georgehrke.com>
Tue, 17 Sep 2019 09:05:55 +0000 (11:05 +0200)
committerGeorg Ehrke <developer@georgehrke.com>
Tue, 17 Sep 2019 10:21:26 +0000 (12:21 +0200)
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
apps/dav/lib/CalDAV/Calendar.php
apps/dav/lib/CalDAV/Publishing/PublishPlugin.php

index 38def19af1da0f8d52f6d0eb074b53abffa88f88..b875d42e0a3967e519fcb0f3628c91c8c68a2b87 100644 (file)
@@ -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'];
                }
index 53059818039f33a413edd00db17fbb96e171ba11..fc276fb25ca4197c95a7f4ae068212ccb734107b 100644 (file)
@@ -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);
                        });
                }
        }