diff options
Diffstat (limited to 'apps/dav/lib/CalDAV/Calendar.php')
-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 fc08c9ac87a..9fedbe6f91f 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -153,7 +153,8 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { } function delete() { - if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) { + if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && + $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { $principal = 'principal:' . parent::getOwner(); $shares = $this->getShares(); $shares = array_filter($shares, function($share) use ($principal){ @@ -283,7 +284,11 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { } private function isShared() { - return isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']); + if (!isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) { + return false; + } + + return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']; } public function isSubscription() { |