Commit 45fe5e42 by Damien Moulard

block access to standard Cotisation admin pages in tav mode

parent 94d5f89e
...@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType; ...@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Component\Validator\Constraints\Regex; use Symfony\Component\Validator\Constraints\Regex;
use Symfony\Component\HttpFoundation\RedirectResponse;
/** /**
* Administration des cotisations. * Administration des cotisations.
...@@ -189,6 +190,14 @@ class CotisationAdmin extends AbstractAdmin ...@@ -189,6 +190,14 @@ class CotisationAdmin extends AbstractAdmin
*/ */
protected function configureListFields(ListMapper $listMapper) protected function configureListFields(ListMapper $listMapper)
{ {
// In TAV env, block access to standard cotisations admin.
// TODO: find a better way (eg. block access with App\EventListener\MenuBuilderListener?)
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$url = $this->getConfigurationPool()->getContainer()->get( 'router' )->generate( 'sonata_admin_dashboard' );
$redirection = new RedirectResponse( $url );
$redirection->send();
}
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
->add('id', 'text', [ ->add('id', 'text', [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment