aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib/Controller/AppConfigController.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-07-25 13:14:49 +0200
committerprovokateurin <kate@provokateurin.de>2024-07-27 21:54:42 +0200
commitb51e432d32223035c69f6024fc79f705252ae60d (patch)
tree89ec811c6532ad1894d4b3d263f6f6a2a39241af /apps/provisioning_api/lib/Controller/AppConfigController.php
parent212a621697cd32b65ea78fa90015cec9d9d1dfe3 (diff)
downloadnextcloud-server-b51e432d32223035c69f6024fc79f705252ae60d.tar.gz
nextcloud-server-b51e432d32223035c69f6024fc79f705252ae60d.zip
refactor(provisioning_api): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/provisioning_api/lib/Controller/AppConfigController.php')
-rw-r--r--apps/provisioning_api/lib/Controller/AppConfigController.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/provisioning_api/lib/Controller/AppConfigController.php b/apps/provisioning_api/lib/Controller/AppConfigController.php
index e26e04a2f8e..65b301245b3 100644
--- a/apps/provisioning_api/lib/Controller/AppConfigController.php
+++ b/apps/provisioning_api/lib/Controller/AppConfigController.php
@@ -11,6 +11,8 @@ namespace OCA\Provisioning_API\Controller;
use OC\AppConfig;
use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
+use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IAppConfig;
@@ -93,9 +95,7 @@ class AppConfigController extends OCSController {
}
/**
- * @PasswordConfirmationRequired
* @NoSubAdminRequired
- * @NoAdminRequired
*
* Update the config value of an app
*
@@ -107,6 +107,8 @@ class AppConfigController extends OCSController {
* 200: Value updated successfully
* 403: App or key is not allowed
*/
+ #[PasswordConfirmationRequired]
+ #[NoAdminRequired]
public function setValue(string $app, string $key, string $value): DataResponse {
$user = $this->userSession->getUser();
if ($user === null) {
@@ -130,8 +132,6 @@ class AppConfigController extends OCSController {
}
/**
- * @PasswordConfirmationRequired
- *
* Delete a config key of an app
*
* @param string $app ID of the app
@@ -141,6 +141,7 @@ class AppConfigController extends OCSController {
* 200: Key deleted successfully
* 403: App or key is not allowed
*/
+ #[PasswordConfirmationRequired]
public function deleteKey(string $app, string $key): DataResponse {
try {
$this->verifyAppId($app);