show/hide some menus depend on the Sonata admin ROLE

后端 未结 1 1671
鱼传尺愫
鱼传尺愫 2021-01-06 08:02

I\'m working on a web project using Symfony2 , and i used Sonata Admin for the admin Panel , every thing works fine but what i want to do is ,on the dashboard menus of sonat

相关标签:
1条回答
  • 2021-01-06 08:08

    i found the solution for this i need just to define the groups on the config.yml Like this

    dashboard:
        groups:
            Content:
                label: Content
                items:
                    - sonata.admin.pages
                    - sonata.admin.menus
                roles: [ ROLE_ADMIN_CONTENT, ROLE_SUPER_ADMIN ]
    
    0 讨论(0)
提交回复
热议问题