如何在SonataAdminbundle列表中删除SonataUserBundle或SonataMediaBundle的默认块?

时间:2014-03-18 18:32:52

标签: symfony yaml sonata-admin sonata-user-bundle sonata-media-bundle

我不知道如何删除UserBundle的默认块,MediaBundle(只是其中之一......)。

这是我的config.yml:

    dashboard:
        blocks:

            # display a dashboard block
            - { position: left, type: sonata.admin.block.admin_list }

#        groups:
#            sonata_page:
#                label: Taules
#                items:
#                    - sonata.admin.collection
#                    - sonata.admin.gender
#                    - sonata.admin.family
#                    - sonata.admin.color
#                    - sonata.admin.size
#                    - sonata.admin.article

我的security.yml:

security:
   encoders:
       FOS\UserBundle\Model\UserInterface: sha512

role_hierarchy:
    ROLE_SONATA_READER:
        - ROLE_SONATA_ADMIN_LIST
        - ROLE_SONATA_ADMIN_VIEW
    ROLE_SONATA_EDITOR:
        - ROLE_SONATA_ADMIN_CREATE
        - ROLE_SONATA_ADMIN_EDIT
    ROLE_SONATA_ADMIN:
        - ROLE_SONATA_ADMIN_DELETE
        - ROLE_SONATA_ADMIN_EXPORT
    ROLE_STAFF:       [ROLE_USER, ROLE_SONATA_READER]
    ROLE_ADMIN:       [ROLE_STAFF ,ROLE_SONATA_EDITOR, ROLE_SONATA_ADMIN]
    ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

1 个答案:

答案 0 :(得分:0)

您可以使用Sonata AdminBundle安全选项来使用Role Handler,只允许一个组访问这些管理。

sonata_admin:
    security:
        handler: sonata.admin.security.handler.role