Override Sonata Users services Menu Group
<p>I make user of the Sonata User Bundle. According to the documentation under section <a href="https://sonata-project.org/bundles/user/3-x/doc/reference/installation.html#extending-the-bundle" rel="nofollow noreferrer">2.5 Extending the Bundle</a> they want me to generate a complete new bundle for my user and group entities. I think this is completely unnecessary and I don't want that extra bundle. So I've created my User and Group entities in my AppBundle and I extend them from the Sonata\UserBundle\Entity\BaseUser entities. </p>

<p>After this, I've changed my fos_user user_class and group_class to my new entities.</p>

<pre><code>fos_user:
    db_driver:      orm
    firewall_name:  main
    user_class:     AppBundle\Entity\User

    group:
        group_class:   AppBundle\Entity\Group
        group_manager: sonata.user.orm.group_manager

    service:
        user_manager: sonata.user.orm.user_manager
</code></pre>

<p>Everything works perfectly, my user and group tables in my database is generated correctly, I can create users through the fos user command line, and I can log in.</p>

<p>In the menu is an automatically generated user group that contain the user and group entities (see the image below). Now the only problem is to override the services for this entities to them to use my own entity classes, because when I click now on one of them they want the entities in the extended bundle that I don't want. How can I tell sonata to make use of my own services? Or even, how can I just remove or hide the Users (with Users and Groups) completely?</p>

<p><a href="https://i.stack.imgur.com/NYy4F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NYy4F.png" alt="enter image description here"></a></p>