Aimeos\ShopBundle\Controller\AdminController::isAdmin PHP Méthode

isAdmin() protected méthode

Checks if the used is authenticated and has the admin role
protected isAdmin ( ) : boolean
Résultat boolean True if authenticated and is admin, false if not
    protected function isAdmin()
    {
        if ($this->has('security.authorization_checker') && $this->get('security.token_storage')->getToken() && $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') || $this->has('security.context') && $this->get('security.context')->getToken() && $this->get('security.context')->isGranted('ROLE_ADMIN')) {
            return true;
        }
        return false;
    }
AdminController