diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-02-25 14:26:02 +0100 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-03-27 17:21:57 +0200 |
commit | b887adf386063a8264fbb11d2d4380528e380d01 (patch) | |
tree | 8b88684ea62713b3ce492e637aa3221f8c5bd87a /apps/dav/lib/Files | |
parent | dc5ba954693ba95b687c517b1bad895f706c8309 (diff) | |
download | nextcloud-server-b887adf386063a8264fbb11d2d4380528e380d01.tar.gz nextcloud-server-b887adf386063a8264fbb11d2d4380528e380d01.zip |
allow sharees to edit certain calendar properties for themselves
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/Files')
-rw-r--r-- | apps/dav/lib/Files/CustomPropertiesBackend.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/dav/lib/Files/CustomPropertiesBackend.php b/apps/dav/lib/Files/CustomPropertiesBackend.php index 43c02e7d6eb..397c7bb22e3 100644 --- a/apps/dav/lib/Files/CustomPropertiesBackend.php +++ b/apps/dav/lib/Files/CustomPropertiesBackend.php @@ -1,9 +1,11 @@ <?php /** * @copyright Copyright (c) 2016, ownCloud, Inc. + * @copyright Copyright (c) 2017, Georg Ehrke <oc.list@georgehrke.com> * * @author Robin Appelman <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Georg Ehrke <oc.list@georgehrke.com> * * @license AGPL-3.0 * @@ -102,6 +104,26 @@ class CustomPropertiesBackend implements BackendInterface { $this->ignoredProperties ); + // substr of calendars/ => path is inside the CalDAV component + // two '/' => this a calendar (no calendar-home nor calendar object) + if (substr($path, 0, 10) === 'calendars/' && substr_count($path, '/') === 2) { + $allRequestedProps = $propFind->getRequestedProperties(); + $customPropertiesForShares = [ + '{DAV:}displayname', + '{urn:ietf:params:xml:ns:caldav}calendar-description', + '{urn:ietf:params:xml:ns:caldav}calendar-timezone', + '{http://apple.com/ns/ical/}calendar-order', + '{http://apple.com/ns/ical/}calendar-color', + '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp', + ]; + + foreach ($customPropertiesForShares as $customPropertyForShares) { + if (in_array($customPropertyForShares, $allRequestedProps)) { + $requestedProps[] = $customPropertyForShares; + } + } + } + if (empty($requestedProps)) { return; } |