Skip to content

Commit

Permalink
refactor: Replace security annotations with attributes in SettingsCon…
Browse files Browse the repository at this point in the history
…troller

Signed-off-by: Josh <[email protected]>
  • Loading branch information
joshtrichards authored Oct 5, 2024
1 parent 36db06b commit 22a232a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

use OCA\LogReader\Constants;
use OCA\LogReader\Service\SettingsService;
use OCA\LogReader\Settings\Admin;
use OCP\AppFramework\ApiController;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AuthorizedAdminSetting;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IConfig;
use OCP\IRequest;
Expand All @@ -31,9 +33,8 @@ public function __construct(

/**
* Get the current app config
*
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
*/
#[AuthorizedAdminSetting(settings: Admin::class)]
public function getAppConfig(): JSONResponse {
return new JSONResponse($this->settingsService->getAppSettings());
}
Expand All @@ -44,8 +45,8 @@ public function getAppConfig(): JSONResponse {
* @param string $settingsKey AppConfig Key to store
* @param mixed $settingsValues Corresponding AppConfig Value
*
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
*/
#[AuthorizedAdminSetting(settings: Admin::class)]
public function updateAppConfig(string $settingsKey, $settingsValue): JSONResponse {
$this->logger->debug('Updating AppConfig: {settingsKey} => {settingsValue}', [
'settingsKey' => $settingsKey,
Expand Down

0 comments on commit 22a232a

Please sign in to comment.