Skip to content

Commit 4166a20

Browse files
committed
fix: improve check if external storage backend is local
Signed-off-by: Robin Appelman <robin@icewind.nl> # Conflicts: # apps/files_external/lib/Controller/GlobalStoragesController.php # apps/files_external/lib/Controller/StoragesController.php
1 parent 728ee25 commit 4166a20

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/files_external/lib/Controller/StoragesController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use OCA\Files_External\Lib\Auth\AuthMechanism;
1111
use OCA\Files_External\Lib\Backend\Backend;
12+
use OCA\Files_External\Lib\Backend\Local;
1213
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
1314
use OCA\Files_External\Lib\StorageConfig;
1415
use OCA\Files_External\NotFoundException;
@@ -78,7 +79,7 @@ protected function createStorage(
7879
?int $priority = null,
7980
) {
8081
$canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true);
81-
if (!$canCreateNewLocalStorage && $backend === 'local') {
82+
if (!$canCreateNewLocalStorage && $this->backendService->getBackend($backend) instanceof Local) {
8283
return new DataResponse(
8384
[
8485
'message' => $this->l10n->t('Forbidden to manage local mounts')

0 commit comments

Comments
 (0)