Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-10-15 21:59:43 +0300
committerGitHub <noreply@github.com>2021-10-15 21:59:43 +0300
commita67a12cb96250144c47ffb99ac1efa8a8c51a6b3 (patch)
tree70f6805d16880edcdcff4ae332e8c3e571db6446 /apps/theming/lib
parentff67ada049fdb26f881450f7899f8eccfcd33310 (diff)
parent719dbafd1339702a170f04ebbc4f20e80d45e8c9 (diff)
Merge pull request #29240 from nextcloud/work/admin-delegation-implementation
Add support for Delegation Settings for more apps
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Controller/ThemingController.php3
-rw-r--r--apps/theming/lib/Settings/Admin.php14
2 files changed, 15 insertions, 2 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index 6d4bd4bae60..82cb15037ce 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -124,6 +124,7 @@ class ThemingController extends Controller {
}
/**
+ * @AuthorizedAdminSetting(settings=OCA\Theming\Settings\Admin)
* @param string $setting
* @param string $value
* @return DataResponse
@@ -208,6 +209,7 @@ class ThemingController extends Controller {
}
/**
+ * @AuthorizedAdminSetting(settings=OCA\Theming\Settings\Admin)
* @return DataResponse
* @throws NotPermittedException
*/
@@ -278,6 +280,7 @@ class ThemingController extends Controller {
/**
* Revert setting to default value
+ * @AuthorizedAdminSetting(settings=OCA\Theming\Settings\Admin)
*
* @param string $setting setting which should be reverted
* @return DataResponse
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index 421bb196cb9..045f0b3fe77 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -33,9 +33,9 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IURLGenerator;
-use OCP\Settings\ISettings;
+use OCP\Settings\IDelegatedSettings;
-class Admin implements ISettings {
+class Admin implements IDelegatedSettings {
/** @var IConfig */
private $config;
/** @var IL10N */
@@ -106,4 +106,14 @@ class Admin implements ISettings {
public function getPriority(): int {
return 5;
}
+
+ public function getName(): ?string {
+ return null; // Only one setting in this section
+ }
+
+ public function getAuthorizedAppConfig(): array {
+ return [
+ 'theming' => '/.*/',
+ ];
+ }
}