summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/Calendar.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-07-08 16:52:20 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-09-26 11:55:36 +0200
commite7085aab387c90f6b5a7f8352864cc0d04bb96d1 (patch)
treeb815396352de0a75083098ca4a8ce0d125fef42f /apps/dav/lib/CalDAV/Calendar.php
parent90ab6e4fd9b25a8f031f812d46915e8413483be2 (diff)
downloadnextcloud-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.php13
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']);
}