diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-05-01 14:37:24 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-05-08 12:09:15 +0200 |
commit | 255442f2817d2504496ca6f60787933c3f064742 (patch) | |
tree | eb48ff7b7c589a7298850237eb8a0369d1e6c989 /apps/dav/lib | |
parent | 2152d5f1f610a40539f11e91318ab27c54400ef3 (diff) | |
download | nextcloud-server-255442f2817d2504496ca6f60787933c3f064742.tar.gz nextcloud-server-255442f2817d2504496ca6f60787933c3f064742.zip |
fix PROPPATCH requests to read-only shared calendars
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 9 |
1 files changed, 7 insertions, 2 deletions
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() { |