我已经广泛阅读并尝试了一些示例,但仍然无法掌握Symfony2 ROLE和Sonata Admin。我有四个级别的用户,
我想在Sonata Admin中:
以下是我的security.yml文件的样子
security:
role_hierarchy:
ROLE_FACILITATOR:
- ROLE_USER
- ROLE_SONATA_ADMIN
- ROLE_SONATA_ADMIN_ENTRY_EDIT
- ROLE_SONATA_ADMIN_ENTRY_LIST
- ROLE_SONATA_ADMIN_ENTRY_CREATE
- ROLE_SONATA_ADMIN_ENTRY_VIEW
- ROLE_SONATA_ADMIN_ENTRY_DELETE
ROLE_AGENCY:
- ROLE_FACILITATOR
- ROLE_SONATA_ADMIN_FACILITATOR_EDIT
- ROLE_SONATA_ADMIN_FACILITATOR_LIST
- ROLE_SONATA_ADMIN_FACILITATOR_CREATE
- ROLE_SONATA_ADMIN_FACILITATOR_VIEW
- ROLE_SONATA_ADMIN_FACILITATOR_DELETE
ROLE_OLX_ADMIN:
- ROLE_AGENCY
- ROLE_SONATA_ADMIN
- ROLE_SONATA_ADMIN_AGENCY_EDIT
- ROLE_SONATA_ADMIN_AGENCY_LIST
- ROLE_SONATA_ADMIN_AGENCY_CREATE
- ROLE_SONATA_ADMIN_AGENCY_VIEW
- ROLE_SONATA_ADMIN_AGENCY_DELETE
ROLE_SUPER_ADMIN:
- ROLE_OLX_ADMIN
- ROLE_ALLOWED_TO_SWITCHS