Commit c8daf473 by Félicie

Merge branch '4315-change-role-redirect-to-index' into 'develop'

redirect to index if switching to comptoir or groupe role

See merge request cooperatic/kohinos-tav!26
parents c8a82722 6cb6ae1e
......@@ -191,7 +191,6 @@ class CotisationAdmin extends AbstractAdmin
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 );
......
......@@ -379,7 +379,11 @@ class IndexController extends AbstractController
$this->session->set('_groupegere', $groupe);
$this->reloadUserTokenFromGroup($group, $request);
return $this->redirectToRoute('sonata_admin_dashboard');
if ($this->getParameter('tav_env') == true) {
return $this->redirectToRoute('index');
} else {
return $this->redirectToRoute('sonata_admin_dashboard');
}
}
/**
......@@ -408,7 +412,11 @@ class IndexController extends AbstractController
$this->session->set('_comptoirgere', $comptoir);
$this->reloadUserTokenFromGroup($group, $request);
return $this->redirectToRoute('sonata_admin_dashboard');
if ($this->getParameter('tav_env') == true) {
return $this->redirectToRoute('index');
} else {
return $this->redirectToRoute('sonata_admin_dashboard');
}
}
/**
......
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