diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-05-08 12:42:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-08 12:42:30 -0500 |
commit | 2d707fdfb5657908bb1c5018f978afb8be5c7563 (patch) | |
tree | fd6102b42b4d27d829495d3ca5aabf78b0dc6756 /apps/dav/lib | |
parent | df6ce6b38595bc6bb5c149f6013872780eb382ad (diff) | |
parent | 255442f2817d2504496ca6f60787933c3f064742 (diff) | |
download | nextcloud-server-2d707fdfb5657908bb1c5018f978afb8be5c7563.tar.gz nextcloud-server-2d707fdfb5657908bb1c5018f978afb8be5c7563.zip |
Merge pull request #4621 from nextcloud/fix_readonly_shared_calendar_proppatch
fix PROPPATCH requests to read-only shared calendars
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() { |