diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php index 3a14faa..b3211e1 100644 --- a/src/Controller/ProfileController.php +++ b/src/Controller/ProfileController.php @@ -24,8 +24,10 @@ class ProfileController extends AbstractController #[Route('/profile', name: 'app_profile')] public function profile(): 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 %}