summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/Settings/Admin.php29
-rw-r--r--apps/federatedfilesharing/tests/Settings/AdminTest.php4
2 files changed, 29 insertions, 4 deletions
diff --git a/apps/federatedfilesharing/lib/Settings/Admin.php b/apps/federatedfilesharing/lib/Settings/Admin.php
index 7dae83c05a9..30fe6f05cf6 100644
--- a/apps/federatedfilesharing/lib/Settings/Admin.php
+++ b/apps/federatedfilesharing/lib/Settings/Admin.php
@@ -27,9 +27,10 @@ namespace OCA\FederatedFileSharing\Settings;
use OCA\FederatedFileSharing\FederatedShareProvider;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\GlobalScale\IConfig;
-use OCP\Settings\ISettings;
+use OCP\IL10N;
+use OCP\Settings\IDelegatedSettings;
-class Admin implements ISettings {
+class Admin implements IDelegatedSettings {
/** @var FederatedShareProvider */
private $fedShareProvider;
@@ -37,15 +38,19 @@ class Admin implements ISettings {
/** @var IConfig */
private $gsConfig;
+ /** @var IL10N */
+ private $l;
+
/**
* Admin constructor.
*
* @param FederatedShareProvider $fedShareProvider
* @param IConfig $globalScaleConfig
*/
- public function __construct(FederatedShareProvider $fedShareProvider, IConfig $globalScaleConfig) {
+ public function __construct(FederatedShareProvider $fedShareProvider, IConfig $globalScaleConfig, IL10N $l) {
$this->fedShareProvider = $fedShareProvider;
$this->gsConfig = $globalScaleConfig;
+ $this->l = $l;
}
/**
@@ -83,4 +88,22 @@ class Admin implements ISettings {
public function getPriority() {
return 20;
}
+
+ public function getName(): ?string {
+ return $this->l->t('Federated Cloud Sharing');
+ }
+
+ public function getAuthorizedAppConfig(): array {
+ return [
+ 'files_sharing' => [
+ 'outgoing_server2server_share_enabled',
+ 'incoming_server2server_share_enabled',
+ 'federatedGroupSharingSupported',
+ 'outgoingServer2serverGroupShareEnabled',
+ 'incomingServer2serverGroupShareEnabled',
+ 'lookupServerEnabled',
+ 'lookupServerUploadEnabled',
+ ],
+ ];
+ }
}
diff --git a/apps/federatedfilesharing/tests/Settings/AdminTest.php b/apps/federatedfilesharing/tests/Settings/AdminTest.php
index 282bc84e86f..0b3a721d7da 100644
--- a/apps/federatedfilesharing/tests/Settings/AdminTest.php
+++ b/apps/federatedfilesharing/tests/Settings/AdminTest.php
@@ -29,6 +29,7 @@ use OCA\FederatedFileSharing\FederatedShareProvider;
use OCA\FederatedFileSharing\Settings\Admin;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\GlobalScale\IConfig;
+use OCP\IL10N;
use Test\TestCase;
class AdminTest extends TestCase {
@@ -45,7 +46,8 @@ class AdminTest extends TestCase {
$this->gsConfig = $this->createMock(IConfig::class);
$this->admin = new Admin(
$this->federatedShareProvider,
- $this->gsConfig
+ $this->gsConfig,
+ $this->createMock(IL10N::class)
);
}