diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-07-08 16:52:20 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-26 11:55:36 +0200 |
commit | e7085aab387c90f6b5a7f8352864cc0d04bb96d1 (patch) | |
tree | b815396352de0a75083098ca4a8ce0d125fef42f /apps/dav/lib/CalDAV/Calendar.php | |
parent | 90ab6e4fd9b25a8f031f812d46915e8413483be2 (diff) | |
download | nextcloud-server-e7085aab387c90f6b5a7f8352864cc0d04bb96d1.tar.gz nextcloud-server-e7085aab387c90f6b5a7f8352864cc0d04bb96d1.zip |
Allow not-authenticated access to specific urls
Diffstat (limited to 'apps/dav/lib/CalDAV/Calendar.php')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 6a811149e26..bda671dfa43 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -90,7 +90,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { } /** - * @return str + * @return string */ public function getPrincipalURI() { return $this->calendarInfo['principaluri']; @@ -124,6 +124,13 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { ]; } } + if ($this->isPublic()) { + $acl[] = [ + 'privilege' => '{DAV:}read', + 'principal' => 'principals/system/public', + 'protected' => true, + ]; + } /** @var CalDavBackend $calDavBackend */ $calDavBackend = $this->caldavBackend; @@ -264,6 +271,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { return true; } + private function isPublic() { + return isset($this->calendarInfo['{http://owncloud.org/ns}public']); + } + private function isShared() { return isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']); } |