On my website, I have admins who have a bunch of roles. I want to limit access to a section to SOME admins, so I ask for a specific role to be granted before entering. The admins need to have the "ROLE_REPORT" role assigned to them to access the /report page.
Here's my code:
security:
role_hierarchy:
ROLE_REPORT : ROLE_USER
ROLE_MERCHANT: ROLE_USER
ROLE_VIRTUAL_TERMINAL: ROLE_MERCHANT
ROLE_ONLINE_CHECKOUT: ROLE_MERCHANT
ROLE_ADMIN: [ROLE_MERCHANT, ROLE_VIRTUAL_TERMINAL, ROLE_ONLINE_CHECKOUT]
ROLE_SUPER_ADMIN: ROLE_ADMIN
access_control:
# Section Report
- { path: /report(.*), roles: ROLE_REPORT}
For some reason, my admin, when the role is granted, cannot access the page. I'm thinking it has to do with the role hierarchy.
Let me know if I can provide you with more info.
Thank you,