Skip to content
Snippets Groups Projects
Unverified Commit b0a3782a authored by Georg Ehrke's avatar Georg Ehrke
Browse files

properly mark birthday calendars as not shareable for now

parent 7149ed74
No related branches found
No related tags found
No related merge requests found
......@@ -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'];
}
......
......@@ -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);
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment