aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2024-07-19 20:23:52 +0200
committerGitHub <noreply@github.com>2024-07-19 20:23:52 +0200
commita8d1673d9fab1097113a58b7640917036e0bd8b5 (patch)
tree9ba1d960db266ebd4c3acd8b7d3945c8d0b54cae /apps
parent3aef5ac05cb1db526ab580d25ada81bcca08a5d3 (diff)
parent5cf9d62c6d43793c7da500727e621bafaf008f57 (diff)
downloadnextcloud-server-a8d1673d9fab1097113a58b7640917036e0bd8b5.tar.gz
nextcloud-server-a8d1673d9fab1097113a58b7640917036e0bd8b5.zip
Merge pull request #46647 from nextcloud/backport/46225/stable28
[stable28] fix(dav): Thrown forbidden error for authenticated user instead of no…
Diffstat (limited to 'apps')
-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 8e5000fa9fb..9891a8cab0d 100644
--- a/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/DavAclPlugin.php
@@ -31,6 +31,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;
@@ -69,13 +70,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;