diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-18 12:12:14 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-29 16:49:55 +0100 |
commit | 6f22784d3db82f07c90e693d647f301636680b4c (patch) | |
tree | 667a0ac3164f53e7fb7137f7abf474b50c79013c /apps/dav/lib | |
parent | 95e218b00c9526bf3cba8ce719b09b1ea9d49ba9 (diff) | |
download | nextcloud-server-6f22784d3db82f07c90e693d647f301636680b4c.tar.gz nextcloud-server-6f22784d3db82f07c90e693d647f301636680b4c.zip |
Allow to hide a shared calendar
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/caldav/calendar.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/caldav/calendar.php b/apps/dav/lib/caldav/calendar.php index 738b366b08d..f35b7175b97 100644 --- a/apps/dav/lib/caldav/calendar.php +++ b/apps/dav/lib/caldav/calendar.php @@ -106,7 +106,9 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { } function propPatch(PropPatch $propPatch) { - if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) { + $mutations = $propPatch->getMutations(); + // If this is a shared calendar, the user can only change the enabled property, to hide it. + if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && (sizeof($mutations) !== 1 || !isset($mutations['{http://owncloud.org/ns}calendar-enabled']))) { throw new Forbidden(); } parent::propPatch($propPatch); |