diff options
Diffstat (limited to 'apps/files/lib/Controller/ApiController.php')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 9c683b7f41f..8bb024fb698 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -105,11 +105,12 @@ class ApiController extends Controller { } // Validate the user is allowed to download the file (preview is some kind of download) + /** @var ISharedStorage $storage */ $storage = $file->getStorage(); if ($storage->instanceOfStorage(ISharedStorage::class)) { - /** @var ISharedStorage $storage */ - $attributes = $storage->getShare()->getAttributes(); - if ($attributes !== null && $attributes->getAttribute('permissions', 'download') === false) { + /** @var IShare $share */ + $share = $storage->getShare(); + if (!$share->canSeeContent()) { throw new NotFoundException(); } } |