private function checkUser()
    {
        static $enabled;

        if (!isset($enabled)) {

            $token = $this->tokenStorage->getToken();

            if ($token) {

                $user = $token->getUser();

                if ($user instanceof \FOS\UserBundle\Model\User) {
                    if ($user->hasRole('ROLE_USER'))
                        $enabled = $token->isAuthenticated();
                }
            } else
                $enabled = false;
        }

        return $enabled;
    }
private function checkUser()
    {
        static $enabled;

        if (!isset($enabled)) {

            $token = $this->tokenStorage->getToken();

            if ($token) {

                $user = $token->getUser();

                if ($user instanceof \FOS\UserBundle\Model\User) {
                    if ($user->hasRole('ROLE_USER'))
                        $enabled = $token->isAuthenticated();
                }
            } else
                $enabled = false;
        }

        return $enabled;
    }
private function checkUser ( ) { static $ enabled ; if ( ! isset ( $ enabled ) ) { $ token = $ this -> tokenStorage -> getToken ( ) ; if ( $ token ) { $ user = $ token -> getUser ( ) ; if ( $ user instanceof \ FOS \ UserBundle \ Model \ User ) { if ( $ user -> hasRole ( 'ROLE_USER' ) ) $ enabled = $ token -> isAuthenticated ( ) ; } } else $ enabled = false ; } return $ enabled ; }
checks if the current User is ROLE_USER

@return bool
checks if the current User is ROLE_USER