2016-07-19 28 views
0

如何在没有奏鸣曲管理员的情况下为自定义路由设置自定义角色,但使用奏鸣曲管理菜单生成器。索纳塔管理员 - 自定义菜单项角色

 sonata.admin.group.content: 
      label:   test 
      label_catalogue: test 
      icon:   '<i class="fa fa-file-text"></i>' 
      items: 
       - route:  custom_route_1 
        label:  'custom_route_1' 
       - route:  custom_route_2 
        label:  'custom_route_2' 
       - route:  custom_route_3 
        label:  'custom_route_3' 

我希望为菜单的每个元素设置不同的角色。

回答

0

您必须在阳明代码添加选项角色:

sonata.admin.group.content: 
     label:   test 
     label_catalogue: test 
     icon:   '<i class="fa fa-file-text"></i>' 
     items: 
      - route:  custom_route_1 
       label:  'custom_route_1' 
      - route:  custom_route_2 
       label:  'custom_route_2' 
      - route:  custom_route_3 
       label:  'custom_route_3' 
     Roles : [ROLE_X, ROLES_Y,.....]