title: Hiding Sonata Admin Menu Elements By Role
body: <p>I have read widely and tried examples but still cannot get the hang of Symfony2 ROLEs and Sonata Admin. I have four levels of users, </p>
  
  <ul>
  <li>SuperAdmin which is basically me the developer</li>
  <li>Admin who is the application owner. He has access to everything except user/ group management. Admin adds an Agency who will get an email with credentials into system</li>
  <li>Agency who then adds the exployees of people(Facilitators) working for the project</li>
  <li>Facilitators who are Agency employees who enter field Entries into the system</li>
  </ul>
  
  <p>I want in Sonata Admin, to:</p>
  
  <ul>
  <li>Facilitators to only see Entry management menu</li>
  <li>Agency to see Entry and Facilitator Management menus only</li>
  <li>Admin to see Agency,Entry and Facilitator management menus only</li>
  <li>SuperAdmin to see everything else including user and Group management generated by SonataUserBundle</li>
  </ul>
  
  <p>Here is how my security.yml file looks like</p>
  
  <pre><code>security:
  role_hierarchy:
      ROLE_FACILITATOR:   
          -   ROLE_USER
          -   ROLE_SONATA_ADMIN
          -   ROLE_SONATA_ADMIN_ENTRY_EDIT
          -   ROLE_SONATA_ADMIN_ENTRY_LIST
          -   ROLE_SONATA_ADMIN_ENTRY_CREATE
          -   ROLE_SONATA_ADMIN_ENTRY_VIEW
          -   ROLE_SONATA_ADMIN_ENTRY_DELETE
      ROLE_AGENCY:
          -   ROLE_FACILITATOR
          -   ROLE_SONATA_ADMIN_FACILITATOR_EDIT
          -   ROLE_SONATA_ADMIN_FACILITATOR_LIST
          -   ROLE_SONATA_ADMIN_FACILITATOR_CREATE
          -   ROLE_SONATA_ADMIN_FACILITATOR_VIEW
          -   ROLE_SONATA_ADMIN_FACILITATOR_DELETE
      ROLE_OLX_ADMIN:
          -   ROLE_AGENCY
          -   ROLE_SONATA_ADMIN
          -   ROLE_SONATA_ADMIN_AGENCY_EDIT
          -   ROLE_SONATA_ADMIN_AGENCY_LIST
          -   ROLE_SONATA_ADMIN_AGENCY_CREATE
          -   ROLE_SONATA_ADMIN_AGENCY_VIEW
          -   ROLE_SONATA_ADMIN_AGENCY_DELETE
      ROLE_SUPER_ADMIN: 
          -   ROLE_OLX_ADMIN
          -   ROLE_ALLOWED_TO_SWITCHS
  </code></pre>