重命名SonataUserBundle角色

时间:2017-03-01 18:39:10

标签: php symfony

我使用SonataUserBundle扩展FOSUserBundle,所以我需要重命名角色名称,因为我的组形式是:

ROLE_USER: ROLE_USER
ROLE_ADMIN: ROLE_USER, ROLE_SONATA_ADMIN
ROLE_SONATA_ADMIN

但我想要这样的东西:

Users
Administrators
Editors

我的security.yml

role_hierarchy:
    ROLE_USER: [ROLE_USER]
    ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN]
    ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
    SONATA:
        - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are not using acl then this line must be uncommented
        - ROLE_SONATA_PAGE_ADMIN_BLOCK_EDIT

0 个答案:

没有答案