How to retrieve full role hierarchy in Symfony

symfony

Solution

You can get the hierarchy from the container:

$container->getParameter('security.role_hierarchy.roles')

Problem

I'm using symfony2 role hierarchy, it works well, but in order to perform some changes, i have to retrieve the `role_hierarchy` set up in my `security.yml`. ``` role_hierarchy: ROLE_USER: [ROLE_ACCESS_USER, ROLE_ACCESS_DATA, ROLE_ACCESS_PRODUCT] ``` Using `getRoles()` just return `ROLE_USER`, how can i know in my code that `ROLE_USER` is made with `ROLE_ACCESS_USER, ROLE_ACCESS_DATA, ROLE_ACCESS_PRODUCT`? thanks for helping.

Original source

Related problems