aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/CachedSubscription.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CalDAV/CachedSubscription.php')
-rw-r--r--apps/dav/lib/CalDAV/CachedSubscription.php49
1 files changed, 17 insertions, 32 deletions
diff --git a/apps/dav/lib/CalDAV/CachedSubscription.php b/apps/dav/lib/CalDAV/CachedSubscription.php
index 18e61450ee9..75ee5cb440f 100644
--- a/apps/dav/lib/CalDAV/CachedSubscription.php
+++ b/apps/dav/lib/CalDAV/CachedSubscription.php
@@ -3,41 +3,22 @@
declare(strict_types=1);
/**
- * @copyright 2018 Georg Ehrke <oc.list@georgehrke.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Georg Ehrke <oc.list@georgehrke.com>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\CalDAV;
use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException;
-use Sabre\CalDAV\Backend\BackendInterface;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\Exception\NotFound;
+use Sabre\DAV\INode;
use Sabre\DAV\PropPatch;
/**
* Class CachedSubscription
*
* @package OCA\DAV\CalDAV
- * @property BackendInterface|CalDavBackend $caldavBackend
+ * @property CalDavBackend $caldavBackend
*/
class CachedSubscription extends \Sabre\CalDAV\Calendar {
@@ -51,7 +32,7 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
/**
* @return array
*/
- public function getACL():array {
+ public function getACL() {
return [
[
'privilege' => '{DAV:}read',
@@ -73,13 +54,18 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
'principal' => '{DAV:}authenticated',
'protected' => true,
],
+ [
+ 'privilege' => '{DAV:}write-properties',
+ 'principal' => $this->getOwner(),
+ 'protected' => true,
+ ]
];
}
/**
* @return array
*/
- public function getChildACL():array {
+ public function getChildACL() {
return [
[
'privilege' => '{DAV:}read',
@@ -97,7 +83,6 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
'principal' => $this->getOwner() . '/calendar-proxy-read',
'protected' => true,
],
-
];
}
@@ -111,7 +96,7 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
return parent::getOwner();
}
-
+
public function delete() {
$this->caldavBackend->deleteSubscription($this->calendarInfo['id']);
}
@@ -139,9 +124,9 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
}
/**
- * @return array
+ * @return INode[]
*/
- public function getChildren():array {
+ public function getChildren(): array {
$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
$children = [];
@@ -169,11 +154,11 @@ class CachedSubscription extends \Sabre\CalDAV\Calendar {
/**
* @param string $name
- * @param null $calendarData
- * @return null|string|void
+ * @param null|resource|string $data
+ * @return null|string
* @throws MethodNotAllowed
*/
- public function createFile($name, $calendarData = null) {
+ public function createFile($name, $data = null) {
throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
}