mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: drop readable check
This check was introduced in a previous PR, causing disruptive changes in PROPFIND responses in some cases. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
parent
22ca454130
commit
678bf538bf
2 changed files with 9 additions and 22 deletions
|
|
@ -531,15 +531,6 @@ class Directory extends Node implements
|
|||
throw new InvalidPath($ex->getMessage(), false, $ex);
|
||||
}
|
||||
|
||||
// if not in a public share with no read permissions, throw Forbidden
|
||||
if (!$allowDirectory && !$info->isReadable()) {
|
||||
if (Server::get(IAppManager::class)->isEnabledForAnyone('files_accesscontrol')) {
|
||||
throw new Forbidden('No read permissions. This might be caused by files_accesscontrol, check your configured rules');
|
||||
}
|
||||
|
||||
throw new Forbidden('No read permissions');
|
||||
}
|
||||
|
||||
if ($info->getMimeType() === FileInfo::MIMETYPE_FOLDER) {
|
||||
$node = new \OCA\DAV\Connector\Sabre\Directory($this->fileView, $info, $this->tree, $this->shareManager);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -299,9 +299,6 @@ class DirectoryTest extends \Test\TestCase {
|
|||
$pathNode->expects($this->once())
|
||||
->method('getPath')
|
||||
->willReturn('/admin/files/my/deep/folder/');
|
||||
$pathNode->expects($this->once())
|
||||
->method('isReadable')
|
||||
->willReturn(true);
|
||||
$pathNode->expects($this->once())
|
||||
->method('getMimetype')
|
||||
->willReturn(FileInfo::MIMETYPE_FOLDER);
|
||||
|
|
@ -352,9 +349,6 @@ class DirectoryTest extends \Test\TestCase {
|
|||
$pathNode->expects($this->once())
|
||||
->method('getPath')
|
||||
->willReturn('/admin/files/my/deep/folder/');
|
||||
$pathNode->expects($this->once())
|
||||
->method('isReadable')
|
||||
->willReturn(true);
|
||||
$pathNode->expects($this->once())
|
||||
->method('getMimetype')
|
||||
->willReturn(FileInfo::MIMETYPE_FOLDER);
|
||||
|
|
@ -393,9 +387,15 @@ class DirectoryTest extends \Test\TestCase {
|
|||
->method('instanceOfStorage')
|
||||
->willReturn(false);
|
||||
|
||||
$directoryNode->expects($this->once())
|
||||
$invokedCount = $this->exactly(2);
|
||||
$directoryNode->expects($invokedCount)
|
||||
->method('isReadable')
|
||||
->willReturn(true);
|
||||
->willReturnCallback(function () use ($invokedCount) {
|
||||
return match ($invokedCount->numberOfInvocations()) {
|
||||
1 => true,
|
||||
2 => false,
|
||||
};
|
||||
});
|
||||
$directoryNode->expects($this->once())
|
||||
->method('getPath')
|
||||
->willReturn('/admin/files/');
|
||||
|
|
@ -403,11 +403,7 @@ class DirectoryTest extends \Test\TestCase {
|
|||
->method('get')
|
||||
->willReturn($pathNode);
|
||||
|
||||
$pathNode->expects($this->once())
|
||||
->method('isReadable')
|
||||
->willReturn(false);
|
||||
|
||||
$this->expectException(\Sabre\DAV\Exception\Forbidden::class);
|
||||
$this->expectException(\Sabre\DAV\Exception\NotFound::class);
|
||||
|
||||
$dir = new Directory($this->view, $directoryNode);
|
||||
$dir->getNodeForPath('/my/deep/folder/');
|
||||
|
|
|
|||
Loading…
Reference in a new issue