function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { $access = parent::checkPrivileges($uri, $privileges, $recursion, false); if ($access === false && $throwExceptions) { /** @var INode $node */ $node = $this->server->tree->getNodeForPath($uri); switch (get_class($node)) { case 'OCA\\DAV\\CardDAV\\AddressBook': $type = 'Addressbook'; break; default: $type = 'Node'; break; } throw new NotFound(sprintf("%s with name '%s' could not be found", $type, $node->getName())); } return $access; }