Skip to content

Commit 22a232a

Browse files
refactor: Replace security annotations with attributes in SettingsController
Signed-off-by: Josh <[email protected]>
1 parent 36db06b commit 22a232a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Controller/SettingsController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
use OCA\LogReader\Constants;
1111
use OCA\LogReader\Service\SettingsService;
12+
use OCA\LogReader\Settings\Admin;
1213
use OCP\AppFramework\ApiController;
1314
use OCP\AppFramework\Http;
15+
use OCP\AppFramework\Http\Attribute\AuthorizedAdminSetting;
1416
use OCP\AppFramework\Http\JSONResponse;
1517
use OCP\IConfig;
1618
use OCP\IRequest;
@@ -31,9 +33,8 @@ public function __construct(
3133

3234
/**
3335
* Get the current app config
34-
*
35-
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
3636
*/
37+
#[AuthorizedAdminSetting(settings: Admin::class)]
3738
public function getAppConfig(): JSONResponse {
3839
return new JSONResponse($this->settingsService->getAppSettings());
3940
}
@@ -44,8 +45,8 @@ public function getAppConfig(): JSONResponse {
4445
* @param string $settingsKey AppConfig Key to store
4546
* @param mixed $settingsValues Corresponding AppConfig Value
4647
*
47-
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
4848
*/
49+
#[AuthorizedAdminSetting(settings: Admin::class)]
4950
public function updateAppConfig(string $settingsKey, $settingsValue): JSONResponse {
5051
$this->logger->debug('Updating AppConfig: {settingsKey} => {settingsValue}', [
5152
'settingsKey' => $settingsKey,

0 commit comments

Comments
 (0)