From e64667df377604c772baec9e24290d2e9944b442 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Thu, 25 Jul 2024 13:14:51 +0200 Subject: [PATCH] refactor(workflowengine): Replace security annotations with respective attributes Signed-off-by: provokateurin --- .../lib/Controller/RequestTimeController.php | 4 ++-- .../lib/Controller/UserWorkflowsController.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/workflowengine/lib/Controller/RequestTimeController.php b/apps/workflowengine/lib/Controller/RequestTimeController.php index 6c0d9d8d4675b..1aca5d92d2ddf 100644 --- a/apps/workflowengine/lib/Controller/RequestTimeController.php +++ b/apps/workflowengine/lib/Controller/RequestTimeController.php @@ -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(); diff --git a/apps/workflowengine/lib/Controller/UserWorkflowsController.php b/apps/workflowengine/lib/Controller/UserWorkflowsController.php index 9be95a2ede902..10197a6f117fc 100644 --- a/apps/workflowengine/lib/Controller/UserWorkflowsController.php +++ b/apps/workflowengine/lib/Controller/UserWorkflowsController.php @@ -10,6 +10,7 @@ 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 @@ public function __construct( * * 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);