src/AppBundle/EventListener/ShowUserListener.php
/**
     * Show the user
     * @param ShowUserEvent $event
     */
Show the user
@param ShowUserEvent $event
Show the user @param ShowUserEvent $event
public function onShowUser(ShowUserEvent $event)
    {
        if (!$this->container->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {
            throw $this->createAccessDeniedException();
        }
        $user = $this->container->get('security.token_storage')->getToken()->getUser();
        $event->setUser($user);
    }
public function onShowUser ( ShowUserEvent $ event ) { if ( ! $ this -> container -> get ( 'security.authorization_checker' ) -> isGranted ( 'IS_AUTHENTICATED_FULLY' ) ) { throw $ this -> createAccessDeniedException ( ) ; } $ user = $ this -> container -> get ( 'security.token_storage' ) -> getToken ( ) -> getUser ( ) ; $ event -> setUser ( $ user ) ; }
Show the user
 @param ShowUserEvent $event
Show the user @param ShowUserEvent $event