From 30f58aca768ca93a85c308b9aa62d9eb4f024622 Mon Sep 17 00:00:00 2001 From: barillote Date: Tue, 8 Apr 2025 08:20:40 +0200 Subject: [PATCH] pull branch romain --- src/Controller/ProfileController.php | 2 ++ templates/degree/index.html.twig | 14 +------------- 2 files changed, 3 insertions(+), 13 deletions(-) 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 %} -
- -
- - {% endif %} - - {% if 'ROLE_ADMIN' in app.user.roles %}
- + Ajouter un nouveau diplôme
- {% endif %} {% endblock %}