简体   繁体   中英

How can delete default block of SonataUserBundle or SonataMediaBundle in SonataAdminbundle list?

I do not know how can delete the default block of UserBundle, MediaBundle (just one of them...).

This is my 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

And my 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]

You can use the Sonata AdminBundle security option to use the Role Handler , to let only one group the access to these administrations.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM