Bundle-Menus

The Core-Bundle contains additions to the KnpMenuBundle in the tpoint\CoreBundle\Menu\Builder-Class.

You can define the Bundle-Menu in the bundle-configuration (services.yml)

services:
    #...
    tpoint.invoice.menu_builder:
        class: tpoint\InvoiceBundle\Menu\Builder
        arguments: ["@knp_menu.factory"]

    tpoint.menu.invoice:
        class: Knp\Menu\MenuItem
        factory_service: tpoint.invoice.menu_builder
        factory_method: appMenu
        tags:
            - { name: knp_menu.menu, alias: invoice_bundlemenu  }
$builder

The Controller can be secured as follows: + Secured with Annotation (@Secure(roles="ROLE_ADMIN") from JMSSecurityExtraBundle) + or manually with in the tpoint-permissions (VIEW for each bundle from the ACL-Voter) to prevent unauthorized admin-access.

Note

Note that the URLs are only listed, if the bundle exists and the user can access the page (checked with $this->authorizationChecker->isGranted('VIEW', $routeAppName)).

Get more informations about the ACL-Voter.