{% if admin.hasAccess('delete', object) and admin.hasRoute('delete') and not object.mandatory %}
    <a href="{{ admin.generateObjectUrl('delete', object) }}" class="btn btn-sm btn-default delete_link" title="{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}">
        <i class="fa fa-times" aria-hidden="true"></i>
        {{ 'action_delete'|trans({}, 'SonataAdminBundle') }}
    </a>
{% endif %}
