diff options
author | Carl Schwan <carl@carlschwan.eu> | 2021-10-15 21:59:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 21:59:43 +0300 |
commit | a67a12cb96250144c47ffb99ac1efa8a8c51a6b3 (patch) | |
tree | 70f6805d16880edcdcff4ae332e8c3e571db6446 /apps/federatedfilesharing | |
parent | ff67ada049fdb26f881450f7899f8eccfcd33310 (diff) | |
parent | 719dbafd1339702a170f04ebbc4f20e80d45e8c9 (diff) |
Merge pull request #29240 from nextcloud/work/admin-delegation-implementation
Add support for Delegation Settings for more apps
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/lib/Settings/Admin.php | 29 | ||||
-rw-r--r-- | apps/federatedfilesharing/tests/Settings/AdminTest.php | 4 |
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) ); } |