Skip to content

Commit 6707066

Browse files
committed
fixup! feat: Add storage wrappert to block download on secure view
1 parent 09e7457 commit 6707066

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Storage/SecureViewWrapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use OC\Files\Storage\Wrapper\Wrapper;
1212
use OCA\Richdocuments\Middleware\WOPIMiddleware;
1313
use OCA\Richdocuments\PermissionManager;
14+
use OCP\Files\Folder;
1415
use OCP\Files\ForbiddenException;
1516
use OCP\Files\IRootFolder;
1617
use OCP\Files\Storage\ISharedStorage;
@@ -46,7 +47,8 @@ public function checkFileAccess($path) {
4647
$isWopiRequest = $this->wopiMiddleware->isWOPIRequest();
4748

4849
$isSharedStorage = $this->instanceOfStorage(ISharedStorage::class);
49-
$node = $this->rootFolder->get($this->mountPoint)->get($path);
50+
$mountNode = $this->rootFolder->get($this->mountPoint);
51+
$node = $mountNode instanceof Folder ? $mountNode->get($path) : $mountNode;
5052
$share = $isSharedStorage && method_exists($this, 'getShare') ? $this->getShare() : null;
5153
$userId = $this->userSession->getUser()?->getUID();
5254

0 commit comments

Comments
 (0)