]> source.dussan.org Git - nextcloud-server.git/commitdiff
refactor(workflowengine): Replace security annotations with respective attributes 46825/head
authorprovokateurin <kate@provokateurin.de>
Thu, 25 Jul 2024 11:14:51 +0000 (13:14 +0200)
committerprovokateurin <kate@provokateurin.de>
Sat, 27 Jul 2024 19:36:15 +0000 (21:36 +0200)
Signed-off-by: provokateurin <kate@provokateurin.de>
apps/workflowengine/lib/Controller/RequestTimeController.php
apps/workflowengine/lib/Controller/UserWorkflowsController.php

index 6c0d9d8d4675b82f1c5cd63c229ba8bd4a515427..1aca5d92d2ddff3401f33179a02dea256e97582e 100644 (file)
@@ -6,16 +6,16 @@
 namespace OCA\WorkflowEngine\Controller;
 
 use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
 use OCP\AppFramework\Http\JSONResponse;
 
 class RequestTimeController extends Controller {
 
        /**
-        * @NoAdminRequired
-        *
         * @param string $search
         * @return JSONResponse
         */
+       #[NoAdminRequired]
        public function getTimezones($search = '') {
                $timezones = \DateTimeZone::listIdentifiers();
 
index 9be95a2ede902a3080b8aae8f015eb9c42fad5b0..10197a6f117fc685406d32e857512e92c6631a4c 100644 (file)
@@ -10,6 +10,7 @@ namespace OCA\WorkflowEngine\Controller;
 
 use OCA\WorkflowEngine\Helper\ScopeContext;
 use OCA\WorkflowEngine\Manager;
+use OCP\AppFramework\Http\Attribute\NoAdminRequired;
 use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
 use OCP\AppFramework\Http\DataResponse;
 use OCP\AppFramework\OCS\OCSBadRequestException;
@@ -44,47 +45,46 @@ class UserWorkflowsController extends AWorkflowController {
         *
         * Example: curl -u joann -H "OCS-APIREQUEST: true" "http://my.nc.srvr/ocs/v2.php/apps/workflowengine/api/v1/workflows/user?format=json"
         *
-        * @NoAdminRequired
         * @throws OCSForbiddenException
         */
+       #[NoAdminRequired]
        public function index(): DataResponse {
                return parent::index();
        }
 
        /**
-        * @NoAdminRequired
-        *
         * Example: curl -u joann -H "OCS-APIREQUEST: true" "http://my.nc.srvr/ocs/v2.php/apps/workflowengine/api/v1/workflows/user/OCA\\Workflow_DocToPdf\\Operation?format=json"
         * @throws OCSForbiddenException
         */
+       #[NoAdminRequired]
        public function show(string $id): DataResponse {
                return parent::show($id);
        }
 
        /**
-        * @NoAdminRequired
         * @throws OCSBadRequestException
         * @throws OCSForbiddenException
         */
+       #[NoAdminRequired]
        #[PasswordConfirmationRequired]
        public function create(string $class, string $name, array $checks, string $operation, string $entity, array $events): DataResponse {
                return parent::create($class, $name, $checks, $operation, $entity, $events);
        }
 
        /**
-        * @NoAdminRequired
         * @throws OCSBadRequestException
         * @throws OCSForbiddenException
         */
+       #[NoAdminRequired]
        #[PasswordConfirmationRequired]
        public function update(int $id, string $name, array $checks, string $operation, string $entity, array $events): DataResponse {
                return parent::update($id, $name, $checks, $operation, $entity, $events);
        }
 
        /**
-        * @NoAdminRequired
         * @throws OCSForbiddenException
         */
+       #[NoAdminRequired]
        #[PasswordConfirmationRequired]
        public function destroy(int $id): DataResponse {
                return parent::destroy($id);