From 255442f2817d2504496ca6f60787933c3f064742 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Mon, 1 May 2017 14:37:24 +0200 Subject: fix PROPPATCH requests to read-only shared calendars Signed-off-by: Georg Ehrke --- apps/dav/lib/CalDAV/Calendar.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps/dav/lib') diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index a216e4e078b..9c56398b14c 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -145,11 +145,16 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { ]; } - if ($this->isShared()) { + $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); + + if (!$this->isShared()) { return $acl; } - return $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); + $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/public']; + return array_filter($acl, function($rule) use ($allowedPrincipals) { + return in_array($rule['principal'], $allowedPrincipals); + }); } public function getChildACL() { -- cgit v1.2.3