ログインしたユーザーにルートまたはパスが許可されていない場合、テンプレートでいくつかのリンクを非表示にする必要があります。このようなもの:
{% if allowedroute 'fos_user_security_logout' %}
<a href="{{ path('fos_user_security_logout') }}" class="action-logout">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% endif %}
ログインしたユーザーのセキュリティ access_control で許可されているかどうかを判断する方法は? 次のような機能があるかもしれません。
$securityContext->isRouteGranted('routeName');
or
$securityContext->isUriGranted('uri/path');