diff --git a/application/symfony/src/DBAL/Types/ActionType.php b/application/symfony/src/DBAL/Types/ActionType.php index 9598413..0ac139d 100644 --- a/application/symfony/src/DBAL/Types/ActionType.php +++ b/application/symfony/src/DBAL/Types/ActionType.php @@ -11,13 +11,13 @@ use App\DBAL\Types\Meta\Right\CRUDType; */ final class ActionType extends CRUDType { - const LIST = 'list'; + const THREAD = 'thread'; protected static $choices = [ parent::CREATE => 'create', parent::READ => 'read', parent::UPDATE => 'update', parent::DELETE => 'delete', - self::LIST => 'list', + self::THREAD => 'thread', ]; } diff --git a/application/symfony/src/Domain/ActionManagement/Create/AbstractCreateAction.php b/application/symfony/src/Domain/ActionManagement/Create/AbstractCreateAction.php index a17e627..f0f9cb4 100644 --- a/application/symfony/src/Domain/ActionManagement/Create/AbstractCreateAction.php +++ b/application/symfony/src/Domain/ActionManagement/Create/AbstractCreateAction.php @@ -7,6 +7,15 @@ use App\Domain\ActionManagement\AbstractAction; /** * @author kevinfrantz */ -abstract class AbstractCreateAction extends AbstractAction +abstract class AbstractCreateAction extends AbstractAction implements CreateActionInterface { + /** + * {@inheritdoc} + * + * @see \App\Domain\ActionManagement\AbstractAction::isSecure() + */ + protected function isSecure(): bool + { + return $this->actionService->isRequestedActionSecure(); + } } diff --git a/application/symfony/src/Domain/ActionManagement/Create/CreateActionInterface.php b/application/symfony/src/Domain/ActionManagement/Create/CreateActionInterface.php new file mode 100644 index 0000000..d912d1f --- /dev/null +++ b/application/symfony/src/Domain/ActionManagement/Create/CreateActionInterface.php @@ -0,0 +1,12 @@ + CRUDType::READ, + ActionType::THREAD => CRUDType::READ, ]; /** diff --git a/application/symfony/tests/Unit/Domain/ActionManagement/ActionFactoryServiceTest.php b/application/symfony/tests/Unit/Domain/ActionManagement/ActionFactoryServiceTest.php index 620d32f..a2dc9d0 100644 --- a/application/symfony/tests/Unit/Domain/ActionManagement/ActionFactoryServiceTest.php +++ b/application/symfony/tests/Unit/Domain/ActionManagement/ActionFactoryServiceTest.php @@ -2,16 +2,15 @@ namespace tests\Unit\Domain\SecureCRUDManagement\Factory; -use App\DBAL\Types\Meta\Right\LayerType; use PHPUnit\Framework\TestCase; use App\Domain\ActionManagement\ActionFactoryServiceInterface; use App\Domain\ActionManagement\ActionFactoryService; use App\Domain\ActionManagement\ActionServiceInterface; -use App\DBAL\Types\ActionType; use App\Domain\ActionManagement\ActionInterface; use App\Domain\RequestManagement\Action\RequestedActionInterface; use App\Domain\RequestManagement\Action\RequestedAction; use App\Domain\RequestManagement\Right\RequestedRight; +use App\Domain\LayerManagement\LayerActionMap; /** * @author kevinfrantz @@ -44,8 +43,8 @@ class ActionFactoryServiceTest extends TestCase public function testCreate(): void { - foreach (ActionType::getChoices() as $action) { - foreach (LayerType::getChoices() as $layer) { + foreach (LayerActionMap::LAYER_ACTION_MAP as $layer => $actions) { + foreach ($actions as $action) { $this->requestedAction->setLayer($layer); $this->requestedAction->setActionType($action); $result = $this->actionFactoryService->create(); diff --git a/application/symfony/tests/Unit/Domain/RequestManagement/Action/RequestedActionTest.php b/application/symfony/tests/Unit/Domain/RequestManagement/Action/RequestedActionTest.php index a4452d4..e06ed55 100644 --- a/application/symfony/tests/Unit/Domain/RequestManagement/Action/RequestedActionTest.php +++ b/application/symfony/tests/Unit/Domain/RequestManagement/Action/RequestedActionTest.php @@ -41,7 +41,7 @@ class RequestedActionTest extends TestCase public function testList(): void { - $list = ActionType::LIST; + $list = ActionType::THREAD; $this->action->setActionType($list); $this->assertEquals($list, $this->action->getActionType()); $this->assertEquals(CRUDType::READ, $this->requestedRight->getCrud());