aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Controller/AWorkflowController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workflowengine/lib/Controller/AWorkflowController.php')
-rw-r--r--apps/workflowengine/lib/Controller/AWorkflowController.php44
1 files changed, 10 insertions, 34 deletions
diff --git a/apps/workflowengine/lib/Controller/AWorkflowController.php b/apps/workflowengine/lib/Controller/AWorkflowController.php
index 77e50526092..6395d0d98f6 100644
--- a/apps/workflowengine/lib/Controller/AWorkflowController.php
+++ b/apps/workflowengine/lib/Controller/AWorkflowController.php
@@ -3,33 +3,15 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de>
- *
- * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
- * @author blizzz <blizzz@arthur-schiwon.de>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\WorkflowEngine\Controller;
use Doctrine\DBAL\Exception;
use OCA\WorkflowEngine\Helper\ScopeContext;
use OCA\WorkflowEngine\Manager;
+use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
@@ -40,22 +22,13 @@ use Psr\Log\LoggerInterface;
abstract class AWorkflowController extends OCSController {
- /** @var Manager */
- protected $manager;
-
- /** @var LoggerInterface */
- private $logger;
-
public function __construct(
$appName,
IRequest $request,
- Manager $manager,
- LoggerInterface $logger
+ protected Manager $manager,
+ private LoggerInterface $logger,
) {
parent::__construct($appName, $request);
-
- $this->manager = $manager;
- $this->logger = $logger;
}
/**
@@ -103,13 +76,14 @@ abstract class AWorkflowController extends OCSController {
* @throws OCSForbiddenException
* @throws OCSException
*/
+ #[PasswordConfirmationRequired]
public function create(
string $class,
string $name,
array $checks,
string $operation,
string $entity,
- array $events
+ array $events,
): DataResponse {
$context = $this->getScopeContext();
try {
@@ -131,13 +105,14 @@ abstract class AWorkflowController extends OCSController {
* @throws OCSForbiddenException
* @throws OCSException
*/
+ #[PasswordConfirmationRequired]
public function update(
int $id,
string $name,
array $checks,
string $operation,
string $entity,
- array $events
+ array $events,
): DataResponse {
try {
$context = $this->getScopeContext();
@@ -159,6 +134,7 @@ abstract class AWorkflowController extends OCSController {
* @throws OCSForbiddenException
* @throws OCSException
*/
+ #[PasswordConfirmationRequired]
public function destroy(int $id): DataResponse {
try {
$deleted = $this->manager->deleteOperation($id, $this->getScopeContext());