Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/dav/lib/Connector/Sabre/FilesPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,16 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node)
$httpRequest = $this->server->httpRequest;

if ($node instanceof \OCA\DAV\Connector\Sabre\Node) {
/**
* This was disabled, because it made dir listing throw an exception,
* so users were unable to navigate into folders where one subitem
* is blocked by the files_accesscontrol app, see:
* https://github.com/nextcloud/files_accesscontrol/issues/65
if (!$node->getFileInfo()->isReadable()) {
// avoid detecting files through this means
throw new NotFound();
}
*/

$propFind->handle(self::FILEID_PROPERTYNAME, function() use ($node) {
return $node->getFileId();
Expand Down
9 changes: 5 additions & 4 deletions apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,12 @@ public function testGetPropertiesForRootDirectory() {
$this->assertEquals('my_fingerprint', $propFind->get(self::DATA_FINGERPRINT_PROPERTYNAME));
}

/**
* @expectedException \Sabre\DAV\Exception\NotFound
*/
public function testGetPropertiesWhenNoPermission() {
/** @var \OCA\DAV\Connector\Sabre\Directory | \PHPUnit_Framework_MockObject_MockObject $node */
// No read permissions can be caused by files access control.
// But we still want to load the directory list, so this is okay for us.
// $this->expectException(\Sabre\DAV\Exception\NotFound::class);

/** @var \OCA\DAV\Connector\Sabre\Directory|\PHPUnit_Framework_MockObject_MockObject $node */
$node = $this->getMockBuilder('\OCA\DAV\Connector\Sabre\Directory')
->disableOriginalConstructor()
->getMock();
Expand Down