sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

How do not show admin class at dashboard and dropdown menu? #460

Closed mshtukin closed 11 years ago

mshtukin commented 12 years ago

I use admin class CampaignImageAdmin in other admin class CampaignAdmin as a sonata_type_collection. So editing of images are managed in CampaignAdmin class when i'm editing campaign. So i don't want CampaignImageAdmin class is shown on dashboard and dropdown menu. But i don't know how can i hide it? Is it possible???

rande commented 12 years ago

Can you post the question on the sonata user mailing list? Thanks On Dec 19, 2011 3:10 PM, "Michael" < reply@reply.github.com> wrote:

I use admin class CampaignImageAdmin in other admin class CampaignAdmin as a sonata_type_collection. So editing of images are managed in CampaignAdmin class when i'm editing campaign. So i don't want CampaignImageAdmin class is shown on dashboard and dropdown menu. But i don't know how can i hide it? Is it possible???


Reply to this email directly or view it on GitHub: https://github.com/sonata-project/SonataAdminBundle/issues/460

damienalexandre commented 12 years ago

As the doc doesn't provide any example of dashboard->groups configuration (http://sonata-project.org/bundles/admin/2-0/doc/reference/configuration.html), let me post mine here:

dashboard:
    groups:
      Products: []
      Orders: []
      References: []

Not sure if it's the best way (and that's why I'm not pushing a PR) but it's working.

EricReiche commented 11 years ago

If anybody else stumbles upon this by googling, the solution is just to add a attribute ( show_in_dashboard ) to the tag of the admin service definition:

        <service id="you-service-id" class="%yourbundle.admin.yourservice.class%">
            <tag name="sonata.admin" manager_type="orm" show_in_dashboard="false"/>
            <argument/>
            <argument>%yourbundle.admin.yourservice.entity%</argument>
            <argument/>
        </service>
mhodges2 commented 11 years ago

For yaml configured bundles show_in_dashboard: false

ureimers commented 10 years ago

@EricReiche Thank you very much! If one combines Google Groups, GitHub issue lists, Stack Overflow and the actual Sonata documentation, most of the features are documented...somewhere ;)

kamalkech commented 10 years ago

But if i want to hide this menu for somes roles ?

antoinemineau commented 10 years ago

There is a good explanation in the sonata reference documentation on how to do that : http://sonata-project.org/bundles/admin/master/doc/reference/security.html