authorizationChecker = $authorizationChecker; } public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { return; } $menu->addChild('Third party', [ 'route' => 'chill_thirdparty_admin_index', ]) ->setAttribute('class', 'list-group-item-header') ->setExtras([ 'order' => 3000, 'icons' => ['male'], ]); $menu->addChild('Third party category', [ 'route' => 'chill_crud_thirdparty_thirdparty-category_index', ])->setExtras(['order' => 3010]); } public static function getMenuIds(): array { return ['admin_section', 'admin_thirdparty']; } }