diff options
Diffstat (limited to 'apps/dav/lib/CalDAV/Calendar.php')
-rw-r--r-- | apps/dav/lib/CalDAV/Calendar.php | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php index 696bbf20a41..a216e4e078b 100644 --- a/apps/dav/lib/CalDAV/Calendar.php +++ b/apps/dav/lib/CalDAV/Calendar.php @@ -30,6 +30,12 @@ use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\PropPatch; +/** + * Class Calendar + * + * @package OCA\DAV\CalDAV + * @property BackendInterface|CalDavBackend $caldavBackend + */ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { public function __construct(BackendInterface $caldavBackend, $calendarInfo, IL10N $l10n) { @@ -67,9 +73,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if ($this->isShared()) { throw new Forbidden(); } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - $calDavBackend->updateShares($this, $add, $remove); + $this->caldavBackend->updateShares($this, $add, $remove); } /** @@ -88,9 +92,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if ($this->isShared()) { return []; } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - return $calDavBackend->getShares($this->getResourceId()); + return $this->caldavBackend->getShares($this->getResourceId()); } /** @@ -147,9 +149,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { return $acl; } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - return $calDavBackend->applyShareAcl($this->getResourceId(), $acl); + return $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl); } public function getChildACL() { @@ -175,9 +175,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { throw new Forbidden(); } - /** @var CalDavBackend $calDavBackend */ - $calDavBackend = $this->caldavBackend; - $calDavBackend->updateShares($this, [], [ + $this->caldavBackend->updateShares($this, [], [ 'href' => $principal ]); return; @@ -201,7 +199,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { throw new NotFound('Calendar object not found'); } - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { throw new NotFound('Calendar object not found'); } @@ -216,7 +214,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']); $children = []; foreach ($objs as $obj) { - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { continue; } $obj['acl'] = $this->getChildACL(); @@ -231,7 +229,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths); $children = []; foreach ($objs as $obj) { - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { continue; } $obj['acl'] = $this->getChildACL(); @@ -246,7 +244,7 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { if (!$obj) { return false; } - if ($this->isShared() && $obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) { + if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) { return false; } |