I'm using Symfony2 with Sonata.
I have a list of sections on my application to which I'd like to give access to my users.
Example:
- John should have access to section1 and section3
- Bob should have access to section2 and section3
So I created 3 roles, that I can attach to users/groups (through sonata)
- ROLE_SECTION1
- ROLE_SECTION2
- ROLE_SECTION3
But as I create new sections, I'd like to have the related roles automatically listed in the admin
(without having to declare them each time in my security.yml
)
I saw sonata-admin-user does that when using the role security handler,
but I don't know how to do the same.
Finally the question is simple and is the following:
How can I add some dynamic selectable roles into my Sonata user admin bundle editor list ?