false]; if($route !== "public" && $route !== "private") throw new NotFoundHttpException(); if($route === "private"){ $u = $this->get('security.token_storage')->getToken()->getUser(); if(!$u instanceof CustomUserInterface) throw new NotFoundHttpException(); if(!$u->hasRole('ROLE_EURO')) throw new NotFoundHttpException(); $bst = $this->container->get('euro44.jsrouting.main')->getBST_private(); } else { $bst = $this->container->get('euro44.jsrouting.main')->getBST_public(); } /* * Ex : search in BST tree => $s = BSTGenesis::searchBSTasArray($bst['tree'],$route); if(!is_bool($s)) $ret['route'] = $s; else $ret['error'] = true;//*/ $ret['tree'] = $bst['tree']; return new JsonResponse($ret); } }