aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-07-19 18:59:58 +0200
committerGitHub <noreply@github.com>2024-07-19 18:59:58 +0200
commit2e273e477abfc992e2841c3b3b8f19839505a944 (patch)
tree32524e7e79a20aa446eca8a9e5222d3e0c9d6de3 /apps/dav/lib
parentbc531be406dd93da1734784862f1b2e705132e26 (diff)
parentf5fcfb4670f31571e0f0e63f106bb4a57bd489c6 (diff)
downloadnextcloud-server-2e273e477abfc992e2841c3b3b8f19839505a944.tar.gz
nextcloud-server-2e273e477abfc992e2841c3b3b8f19839505a944.zip
Merge pull request #46225 from nextcloud/fix/issue-11633
fix(dav): Thrown forbidden error for authenticated user instead of no…
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/DavAclPlugin.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
index c499f806eba..336930cf17d 100644
--- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
@@ -11,6 +11,7 @@ use OCA\DAV\CalDAV\CachedSubscription;
use OCA\DAV\CalDAV\Calendar;
use OCA\DAV\CardDAV\AddressBook;
use Sabre\CalDAV\Principal\User;
+use Sabre\DAV\Exception\Forbidden;
use Sabre\DAV\Exception\NotFound;
use Sabre\DAV\INode;
use Sabre\DAV\PropFind;
@@ -49,13 +50,19 @@ class DavAclPlugin extends \Sabre\DAVACL\Plugin {
$type = 'Node';
break;
}
- throw new NotFound(
- sprintf(
- "%s with name '%s' could not be found",
- $type,
- $node->getName()
- )
- );
+
+ if ($this->getCurrentUserPrincipal() === $node->getOwner()) {
+ throw new Forbidden("Access denied");
+ } else {
+ throw new NotFound(
+ sprintf(
+ "%s with name '%s' could not be found",
+ $type,
+ $node->getName()
+ )
+ );
+ }
+
}
return $access;