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