{% block user_block %}
    <br/>
    <a href="{{ path('sonata_admin_dashboard') }}">&nbsp;&nbsp;Main page</a>
    <br/><br/>
    <a href="{{ path('nelmio_api_doc_index') }}">&nbsp;&nbsp;Logout</a>
    <br/><br/>
{% endblock%}
{% block user_block %}
    <br/>
    <a href="{{ path('sonata_admin_dashboard') }}">&nbsp;&nbsp;Main page</a>
    <br/><br/>
    <a href="#">&nbsp;&nbsp;Logout</a>
    <br/><br/>
{% endblock%}

Remove logout link from admin
Remove logout link from admin
