aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Service/BackendService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Service/BackendService.php')
-rw-r--r--apps/files_external/lib/Service/BackendService.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php
index 4726dbd4cad..3a688ee66e6 100644
--- a/apps/files_external/lib/Service/BackendService.php
+++ b/apps/files_external/lib/Service/BackendService.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -12,6 +13,7 @@ use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\Config\IAuthMechanismProvider;
use OCA\Files_External\Lib\Config\IBackendProvider;
+use OCA\Files_External\Lib\MissingDependency;
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IAppConfig;
@@ -187,7 +189,8 @@ class BackendService {
*/
public function getAvailableBackends() {
return array_filter($this->getBackends(), function ($backend) {
- return !$backend->checkDependencies();
+ $missing = array_filter($backend->checkDependencies(), fn (MissingDependency $dependency) => !$dependency->isOptional());
+ return count($missing) === 0;
});
}
@@ -256,8 +259,8 @@ class BackendService {
* @return bool
*/
protected function isAllowedUserBackend(Backend $backend) {
- if ($this->userMountingAllowed &&
- array_intersect($backend->getIdentifierAliases(), $this->userMountingBackends)
+ if ($this->userMountingAllowed
+ && array_intersect($backend->getIdentifierAliases(), $this->userMountingBackends)
) {
return true;
}