Browse Source

Remplacement has_role par IsGranted

François 5 years ago
parent
commit
b5d9f4615d

+ 2 - 2
src/Controller/RealisateurController.php

@@ -4,7 +4,7 @@ namespace App\Controller;
 
 use App\Entity\Realisateur;
 use App\Form\RealisateurType;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\HttpFoundation\Request;
@@ -73,7 +73,7 @@ class RealisateurController extends AbstractController
 
 	/**
 	 * @Route("/real/supprimer/{id}", name="realisateur_supprimer")
-     * @Security("has_role('ROLE_ADMIN')")
+     * @IsGranted("ROLE_ADMIN")
 	 */
 	public function supprimerAction(Request $request, Realisateur $realisateur)
     {

+ 2 - 2
src/Controller/VideothequeController.php

@@ -5,7 +5,7 @@ namespace App\Controller;
 use App\Entity\Commentaire;
 use App\Entity\Realisateur;
 use App\Service\UniciteCollections;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\Routing\Annotation\Route;
@@ -106,7 +106,7 @@ class VideothequeController extends AbstractController
 
 	/**
 	 * @Route("/supprimer/{id}", name="videotheque_supprimer")
-     * @Security("is_granted('ROLE_ADMIN')")
+     * @IsGranted("ROLE_ADMIN")
 	 */
 	public function supprimerAction(Request $request, Film $film)
 	{