src/Controller/SettingsController.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  7. use Symfony\Component\HttpFoundation\Response;
  8. class SettingsController extends AbstractController
  9. {
  10.     /**
  11.      * @Route("/", name="settings")
  12.      */
  13.     public function index()
  14.     {
  15.         if (!$this->isGranted('ROLE_ADMIN') && !$this->isGranted('ROLE_CHANCELLOR')) {
  16.             return $this->redirect('/meeting');
  17.         }
  18.         if ($this->isGranted('ROLE_CHANCELLOR')) {
  19.             return $this->redirectToRoute('group_index');
  20.         }
  21.         return $this->redirectToRoute('user_index');
  22.     }
  23. }