diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php index 8263c94..5929e2b 100644 --- a/src/Controller/ProfileController.php +++ b/src/Controller/ProfileController.php @@ -19,8 +19,10 @@ class ProfileController extends AbstractController #[Route('/profile', name: 'app_profile')] public function profile(EntityManagerInterface $entityManager): Response { + // Charger l'utilisateur connecté $user = $this->getUser(); + // Vérifiez les rôles si nécessaire if (!$user) { throw $this->createAccessDeniedException('Vous devez être connecté pour accéder à cette page.'); } diff --git a/templates/degree/index.html.twig b/templates/degree/index.html.twig index 0b309fd..b5b86e8 100644 --- a/templates/degree/index.html.twig +++ b/templates/degree/index.html.twig @@ -56,23 +56,11 @@ - {% if 'ROLE_INTERN' in app.user.roles %} -