From 5f6997f6fe0955e650625a769195e1e896a9f04e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 27 Oct 2022 14:15:56 +0200 Subject: [PATCH] Add an hint about reasons why files can't be accessed Hopefully saves some debugging time next time Signed-off-by: Carl Schwan --- apps/dav/lib/Connector/Sabre/Directory.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/Directory.php b/apps/dav/lib/Connector/Sabre/Directory.php index b575a051b2a..bffe99449cb 100644 --- a/apps/dav/lib/Connector/Sabre/Directory.php +++ b/apps/dav/lib/Connector/Sabre/Directory.php @@ -255,7 +255,11 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol if (!$this->info->isReadable()) { // return 403 instead of 404 because a 404 would make // the caller believe that the collection itself does not exist - throw new Forbidden('No read permissions'); + if (\OC_App::isEnabled('files_accesscontrol')) { + throw new Forbidden('No read permissions. This might be caused by files_accesscontrol, check your configured rules'); + } else { + throw new Forbidden('No read permissions'); + } } $folderContent = $this->getNode()->getDirectoryListing(); } catch (LockedException $e) {