A
A
Anton2016-06-29 13:47:49
symfony
Anton, 2016-06-29 13:47:49

How to solve problem with role hierarchy in Symfony?

The situation is this - I brought the hierarchy to the base, made a service (and overridden it security.role_hierarchy), which expands BasicRoleHierarchyand passes my hierarchy to it in the constructor, which so far looks like this:

Array
(
    [ROLE_ADMIN] => Array
        (
            [0] => ROLE_USER
        )

    [ROLE_USER] => Array
        (
            [0] => ROLE_CAN_VIEW_MAIN
        )

    [ROLE_CAN_VIEW_MAIN] => Array
        (
        )

)

the method that gives the role of the user returns only his role, I go under the administrator and in the controller I check ROLE_CAN_VIEW_MAIN or ROLE_USER - gives 403, if you check ROLE_ADMIN, then it starts up normally
What did I do wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-06-29
@brud

stackoverflow.com/questions/34580321/how-to-change... found the answer here - if there is no array with hierarchy in security.yml, then the woter is cut off

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question