src/Zicht/Bundle/MenuBundle/Security/Authorization/MenuVoter.php
protected function userIsAllowed(TokenInterface $token)
    {
        /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */
        foreach ($this->hierarchy->getReachableRoles($token->getRoles()) as $role) {
            if ($role->getRole() === self::ROLE_ADMIN_MENU_ITEM) {
                return true;
            }
        }
        return false;
    }
protected function userIsAllowed(TokenInterface $token)
    {
        /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */
        foreach ($this->hierarchy->getReachableRoles($token->getRoles()) as $role) {
            if ($role->getRole() === self::ROLE_ADMIN_MENU_ITEM) {
                return true;
            }
        }
        return false;
    }
protected function userIsAllowed ( TokenInterface $ token ) { /** @var \Symfony\Component\Security\Core\Role\RoleInterface $role */ foreach ( $ this -> hierarchy -> getReachableRoles ( $ token -> getRoles ( ) ) as $ role ) { if ( $ role -> getRole ( ) === self :: ROLE_ADMIN_MENU_ITEM ) { return true ; } } return false ; }
Calculate whether the current token is allowed.

@param TokenInterface $token
@return  bool
Calculate whether the current token is allowed .