|
30 | 30 |
|
31 | 31 | use OCA\Files_External\Lib\Auth\AuthMechanism; |
32 | 32 | use OCA\Files_External\Lib\Backend\Backend; |
| 33 | +use OCA\Files_External\Lib\Backend\Local; |
33 | 34 | use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException; |
34 | 35 | use OCA\Files_External\Lib\StorageConfig; |
35 | 36 | use OCA\Files_External\NotFoundException; |
| 37 | +use OCA\Files_External\Service\BackendService; |
36 | 38 | use OCA\Files_External\Service\StoragesService; |
37 | 39 | use OCP\AppFramework\Controller; |
38 | 40 | use OCP\AppFramework\Http; |
@@ -67,7 +69,8 @@ public function __construct( |
67 | 69 | protected LoggerInterface $logger, |
68 | 70 | protected IUserSession $userSession, |
69 | 71 | protected IGroupManager $groupManager, |
70 | | - protected IConfig $config |
| 72 | + protected IConfig $config, |
| 73 | + private BackendService $backendService |
71 | 74 | ) { |
72 | 75 | parent::__construct($AppName, $request); |
73 | 76 | } |
@@ -97,7 +100,7 @@ protected function createStorage( |
97 | 100 | $priority = null |
98 | 101 | ) { |
99 | 102 | $canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true); |
100 | | - if (!$canCreateNewLocalStorage && $backend === 'local') { |
| 103 | + if (!$canCreateNewLocalStorage && $this->backendService->getBackend($backend) instanceof Local) { |
101 | 104 | return new DataResponse( |
102 | 105 | [ |
103 | 106 | 'message' => $this->l10n->t('Forbidden to manage local mounts') |
|
0 commit comments