i am working with symfony 3 and phpMyAdmin and i am trying to customize the menu part of the EasyAdmin bundle based on an ROLE_ADMIN or SUPPER_ADMIN_ROLE Any HELP ??!
There is no out of the box way to restrict routes to certain roles, but it is easily added. In your routes yaml you can introduce a new attribute to a route, e.g. role
:
easy_admin:
design:
menu:
- label: 'Products'
icon: 'shopping-basket'
css_class: 'label-custom-css-class'
role: ROLE_ADMIN
Then you have to overwrite the menu.yaml from the EasyAdminBundle. Basically you copy the code and then add a snippet that does something like:
{% if item.role is defined and is_granted(item.role) %}
<!-- link -->
{% endif %}