Symfony granting path access to multiple roles in security.yml
This is the way to go and what i'm using:
- { path: ^/admin, roles: [ROLE_ADMIN, ROLE_TEACHER] }
You can use the role hierarchy in security.yml
:
role_hierarchy: ROLE_ADMIN: [ROLE_TEACHER]#...access_control: - { path: ^/admin, roles: ROLE_TEACHER}
So all of this roles will have access to that path.