Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(WebDav): use correct SabreDav Forbidden exception
Browse files Browse the repository at this point in the history
... \Sabre\DAV\Forbidden does not exist

Change-Id: Ia8f6cbac31483cb86f796ef0f62ff8482f9eca87
Reviewed-on: http://gerrit.tine20.com/customers/15311
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
  • Loading branch information
pschuele committed Jan 15, 2020
1 parent d232fbb commit 2ebabf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tine20/Calendar/Frontend/WebDAV.php
Expand Up @@ -22,6 +22,7 @@ class Calendar_Frontend_WebDAV extends Tinebase_WebDav_Collection_AbstractContai
/**
* (non-PHPdoc)
* @see \Sabre\DAV\IExtendedCollection::createExtendedCollection()
* @throws \Sabre\DAV\Exception\Forbidden
*/
public function createExtendedCollection($name, array $resourceType, array $properties)
{
Expand All @@ -34,7 +35,7 @@ public function createExtendedCollection($name, array $resourceType, array $prop
if (Tinebase_Core::getUser()->hasRight('Tasks', Tinebase_Acl_Rights::RUN)) {
$tasks = new Tasks_Frontend_WebDAV('tasks/' . $this->getName(), $this->_useIdAsName);
} else {
throw new \Sabre\DAV\Forbidden('Tasks not allowed for user');
throw new \Sabre\DAV\Exception\Forbidden('Tasks not allowed for user');
}

return $tasks->createExtendedCollection($name, $resourceType, $properties);
Expand Down
4 changes: 2 additions & 2 deletions tine20/Tinebase/WebDav/Collection/AbstractContainerTree.php
Expand Up @@ -1087,7 +1087,7 @@ protected function _parsePath($_path)
/**
* @param $_id
* @return Tinebase_Model_FullUser
* @throws \Sabre\DAV\Forbidden
* @throws \Sabre\DAV\Exception\Forbidden
*/
protected function _getUser($_id)
{
Expand All @@ -1101,7 +1101,7 @@ protected function _getUser($_id)
try {
$contact = Addressbook_Controller_Contact::getInstance()->get($_id);
} catch (Tinebase_Exception_AccessDenied $tead) {
throw new \Sabre\DAV\Forbidden('No permission to get user / contact');
throw new \Sabre\DAV\Exception\Forbidden('No permission to get user / contact');
}
$user = Tinebase_User::getInstance()->getUserByPropertyFromSqlBackend('accountId', $contact->account_id, 'Tinebase_Model_FullUser');
} else {
Expand Down

0 comments on commit 2ebabf9

Please sign in to comment.