src/Controller/BIController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. /**
  7.  * @Route("/bi")
  8.  *
  9.  */
  10. class BIController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/index", name="index_bi")
  14.      */
  15.     public function index()
  16.     {
  17.         //se verifica inicio de sesión correcto 
  18.         $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
  19.         if ($this->isGranted('ROLE_ADMIN')){
  20.             return $this->render('bi/index.html.twig', [
  21.             ]);
  22.         }elseif($this->isGranted('ROLE_TITULAR')){
  23.             return $this->redirectToRoute('home', [], Response::HTTP_SEE_OTHER);
  24.         }elseif($this->isGranted('ROLE_MUNICIPIO')){
  25.             return $this->redirectToRoute('home', [], Response::HTTP_SEE_OTHER);
  26.         }
  27.     }
  28. }