|
9 | 9 |
|
10 | 10 | use OCA\Files_External\Lib\Auth\AuthMechanism; |
11 | 11 | use OCA\Files_External\Lib\Backend\Backend; |
| 12 | +use OCA\Files_External\Lib\Backend\Local; |
12 | 13 | use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException; |
13 | 14 | use OCA\Files_External\Lib\StorageConfig; |
14 | 15 | use OCA\Files_External\MountConfig; |
15 | 16 | use OCA\Files_External\NotFoundException; |
| 17 | +use OCA\Files_External\Service\BackendService; |
16 | 18 | use OCA\Files_External\Service\StoragesService; |
17 | 19 | use OCP\AppFramework\Controller; |
18 | 20 | use OCP\AppFramework\Http; |
@@ -48,6 +50,7 @@ public function __construct( |
48 | 50 | protected IUserSession $userSession, |
49 | 51 | protected IGroupManager $groupManager, |
50 | 52 | protected IConfig $config, |
| 53 | + private BackendService $backendService, |
51 | 54 | ) { |
52 | 55 | parent::__construct($appName, $request); |
53 | 56 | } |
@@ -77,7 +80,7 @@ protected function createStorage( |
77 | 80 | ?int $priority = null, |
78 | 81 | ) { |
79 | 82 | $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); |
80 | | - if (!$canCreateNewLocalStorage && $backend === 'local') { |
| 83 | + if (!$canCreateNewLocalStorage && $this->backendService->getBackend($backend) instanceof Local) { |
81 | 84 | return new DataResponse( |
82 | 85 | [ |
83 | 86 | 'message' => $this->l10n->t('Forbidden to manage local mounts') |
|
0 commit comments