I've problem with my hierarchical role in security.yml
role_hierarchy
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
ROLE_ADMIN: [ROLE_PILOT, ROLE_EXPERT]
ROLE_PILOT: ROLE_PRODIVER
ROLE_PROVIDER: ROLE_PROVIDER_EXTERNAL
ROLE_PROVIDER_EXTERNAL: ROLE_USER
When i'm using *is_granted* in TWIG :
{% if is_granted('ROLE_PROVIDER_EXTERNAL') %}
<li class="dropdown">[...]</li>
{% endif %}
Normally the ROLE_PILOT should be able to view this HTML element with the inheritance of roles. But if user is connected in ROLE_PILOT, HTML element cannot display for him...
Anyone have an idea for my problem ?
Thx
var_dump($this->getContainer()->getParameter('security.role_hierarchy.roles'))(in a controller) returns? - FlaskROLE_PROVIDER_EXTERNAL => ["ROLE_USER"] ROLE_PROVIDER => ["ROLE_PROVIDER_EXTERNAL"] ROLE_PILOT =>["ROLE_PRODIVER"] ROLE_ADMIN => ["ROLE_PILOT", "ROLE_EXPERT"] ROLE_SUPER_ADMIN ["ROLE_ADMIN", "ROLE_ALLOWED_TO_SWITCH"]- RudySkate