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
This commit is contained in:
Robin Appelman 2026-05-04 18:35:24 +02:00
parent 728ee257b3
commit 4166a20a6d
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -9,6 +9,7 @@ namespace OCA\Files_External\Controller;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\Backend\Local;
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
@ -78,7 +79,7 @@ abstract class StoragesController extends Controller {
?int $priority = null,
) {
$canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', true);
if (!$canCreateNewLocalStorage && $backend === 'local') {
if (!$canCreateNewLocalStorage && $this->backendService->getBackend($backend) instanceof Local) {
return new DataResponse(
[
'message' => $this->l10n->t('Forbidden to manage local mounts')