From ec29f42f901f620b05718618cd9dfff375ec2e91 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 4 Sep 2025 11:43:42 +0200 Subject: [PATCH] Redirect to Organization Dashboard --- src/Controller/IndexController.php | 5 ++++- templates/elements/menu.html.twig | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 3bbe8df..2d7946c 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -12,8 +12,11 @@ use Symfony\Component\Routing\Attribute\Route; final class IndexController extends AbstractController { #[Route('/', name: 'app_index')] - public function index(Request $request, LoggerInterface $logger): Response + public function index(): Response { + if($this->isGranted('ROLE_ADMIN')){ + return $this->redirectToRoute('organization_index'); + } return $this->render('index/index.html.twig', [ 'controller_name' => 'IndexController', ]); diff --git a/templates/elements/menu.html.twig b/templates/elements/menu.html.twig index a330923..c4d104c 100644 --- a/templates/elements/menu.html.twig +++ b/templates/elements/menu.html.twig @@ -29,23 +29,24 @@ {# if user is Super Admin #} - {% if is_granted('ROLE_ADMIN') %} + {% if is_granted('ROLE_SUPER_ADMIN') %} - {% endif %} + + \ No newline at end of file