Loading module/Application/src/Controller/DroitsController.php +19 −7 Changes for module/Application/src/Controller/DroitsController.php: 19 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -12,11 +12,11 @@ use Application\Service\Traits\AffectationServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\RoleServiceAwareTrait; use Application\Service\Traits\SourceServiceAwareTrait; use Doctrine\Common\Cache\FilesystemCache; use Intervenant\Service\StatutServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Form\Droits\Traits\RoleFormAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Application\Traits\DoctrineCacheAwareTrait; use UnicaenAuth\Service\Traits\PrivilegeServiceAwareTrait; use Intervenant\Entity\Db\Statut; use UnicaenAuth\Entity\Db\Privilege; Loading @@ -40,7 +40,19 @@ class DroitsController extends AbstractController use AffectationFormAwareTrait; use ContextServiceAwareTrait; use CacheContainerTrait; use DoctrineCacheAwareTrait; protected FilesystemCache $doctrineCache; /** * @param FilesystemCache $doctrineCache */ public function __construct(FilesystemCache $doctrineCache) { $this->doctrineCache = $doctrineCache; } /** Loading Loading @@ -85,7 +97,7 @@ class DroitsController extends AbstractController if ($form->isValid()) { try { $this->getServiceRole()->save($role); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); $form->get('id')->setValue($role->getId()); // transmet le nouvel ID } catch (\Exception $e) { $errors[] = $this->translate($e); Loading @@ -105,7 +117,7 @@ class DroitsController extends AbstractController $title = "Suppression du rôle"; $form = $this->makeFormSupprimer(function () use ($role) { $this->getServiceRole()->delete($role); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); $cc = $this->getCacheContainer(PrivilegeService::class); unset($cc->privilegesRoles); }); Loading Loading @@ -183,7 +195,7 @@ class DroitsController extends AbstractController if ($statut) $this->statutRemovePrivilege($statut, $privilege); break; } $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('role', 'statut', 'privilege'); } Loading Loading @@ -289,7 +301,7 @@ class DroitsController extends AbstractController } } } $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('form', 'title', 'errors'); } Loading @@ -305,7 +317,7 @@ class DroitsController extends AbstractController $form = $this->makeFormSupprimer(function () use ($affectation) { $this->getServiceAffectation()->delete($affectation); }); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('affectation', 'title', 'form'); } Loading module/Application/src/Controller/Factory/DroitsControllerFactory.php +3 −1 Changes for module/Application/src/Controller/Factory/DroitsControllerFactory.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ class DroitsControllerFactory */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $controller = new DroitsController(); $doctrineCache = $container->get('doctrine.cache.filesystem'); $controller = new DroitsController($doctrineCache); $controller->setServicePrivilege($container->get('UnicaenAuth\Service\Privilege')); return $controller; Loading module/Application/src/Traits/DoctrineCacheAwareTrait.php −18 File deleted. Show changes module/Application/src/Traits/RoleAwareTrait.php −x−43 File deleted. Show changes Loading
module/Application/src/Controller/DroitsController.php +19 −7 Changes for module/Application/src/Controller/DroitsController.php: 19 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -12,11 +12,11 @@ use Application\Service\Traits\AffectationServiceAwareTrait; use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\RoleServiceAwareTrait; use Application\Service\Traits\SourceServiceAwareTrait; use Doctrine\Common\Cache\FilesystemCache; use Intervenant\Service\StatutServiceAwareTrait; use Application\Service\Traits\StructureServiceAwareTrait; use Application\Form\Droits\Traits\RoleFormAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Application\Traits\DoctrineCacheAwareTrait; use UnicaenAuth\Service\Traits\PrivilegeServiceAwareTrait; use Intervenant\Entity\Db\Statut; use UnicaenAuth\Entity\Db\Privilege; Loading @@ -40,7 +40,19 @@ class DroitsController extends AbstractController use AffectationFormAwareTrait; use ContextServiceAwareTrait; use CacheContainerTrait; use DoctrineCacheAwareTrait; protected FilesystemCache $doctrineCache; /** * @param FilesystemCache $doctrineCache */ public function __construct(FilesystemCache $doctrineCache) { $this->doctrineCache = $doctrineCache; } /** Loading Loading @@ -85,7 +97,7 @@ class DroitsController extends AbstractController if ($form->isValid()) { try { $this->getServiceRole()->save($role); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); $form->get('id')->setValue($role->getId()); // transmet le nouvel ID } catch (\Exception $e) { $errors[] = $this->translate($e); Loading @@ -105,7 +117,7 @@ class DroitsController extends AbstractController $title = "Suppression du rôle"; $form = $this->makeFormSupprimer(function () use ($role) { $this->getServiceRole()->delete($role); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); $cc = $this->getCacheContainer(PrivilegeService::class); unset($cc->privilegesRoles); }); Loading Loading @@ -183,7 +195,7 @@ class DroitsController extends AbstractController if ($statut) $this->statutRemovePrivilege($statut, $privilege); break; } $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('role', 'statut', 'privilege'); } Loading Loading @@ -289,7 +301,7 @@ class DroitsController extends AbstractController } } } $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('form', 'title', 'errors'); } Loading @@ -305,7 +317,7 @@ class DroitsController extends AbstractController $form = $this->makeFormSupprimer(function () use ($affectation) { $this->getServiceAffectation()->delete($affectation); }); $this->getCacheFilesystem()->delete(RoleProvider::class . '/affectations'); $this->doctrineCache->delete(RoleProvider::class . '/affectations'); return compact('affectation', 'title', 'form'); } Loading
module/Application/src/Controller/Factory/DroitsControllerFactory.php +3 −1 Changes for module/Application/src/Controller/Factory/DroitsControllerFactory.php: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -16,7 +16,9 @@ class DroitsControllerFactory */ public function __invoke(ContainerInterface $container, $requestedName, $options = null) { $controller = new DroitsController(); $doctrineCache = $container->get('doctrine.cache.filesystem'); $controller = new DroitsController($doctrineCache); $controller->setServicePrivilege($container->get('UnicaenAuth\Service\Privilege')); return $controller; Loading