×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: HTML
Posted by: Pascual Muñoz
Added: Oct 30, 2016 10:11 AM
Modified: Oct 30, 2016 10:17 AM
Views: 7
Como checkear si es el Admin desde html
  1. http://symfony.com/doc/current/security.html
  2.  
  3.  in html:
  4.         is_granted('IS_AUTHENTICATED_FULLY')
  5.  in PHP:
  6.         http://stackoverflow.com/questions/10271570/how-to-check-if-an-user-is-logged-in-symfony2-inside-a-controller
  7.  
  8. $securityContext = $this->container->get('security.authorization_checker');
  9. if ($securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
  10.     // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)
  11. }
  12.