svg
This commit is contained in:
parent
fdbccaed08
commit
047652dded
@ -138,6 +138,30 @@ class ConfigController extends Controller
|
||||
return $config;
|
||||
}
|
||||
|
||||
public function permmodoAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$sidebars=$this->get('session')->get('sidebar');
|
||||
|
||||
$perms=[];
|
||||
foreach($sidebars as $sidebar) {
|
||||
foreach($sidebar["childs"] as $child) {
|
||||
$permmod=$em->getRepository("CadolesCoreBundle:PermModo")->findOneBy(["route"=>$child["path"]]);
|
||||
if($permmod) {
|
||||
array_push($perms,['label'=>$sidebar['label'].' >> '.$child['label'],'visible'=>$permmod->getVisible()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('CadolesCoreBundle:Config:permmodo.html.twig', [
|
||||
'useheader' => true,
|
||||
'usemenu' => false,
|
||||
'usesidebar' => true,
|
||||
'permmodos' => $perms
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getErrorForm($form,$request,$data) {
|
||||
if ($form->get('submit')->isClicked() && !$form->isValid()) {
|
||||
$this->get('session')->getFlashBag()->clear();
|
||||
|
@ -113,7 +113,6 @@
|
||||
$request = $event->getRequest();
|
||||
$route = $request->attributes->get('_route');
|
||||
if($route!="cadoles_core_config"&&stripos($route,"_config")!==false) {
|
||||
error_log($route);
|
||||
if(stripos($route,"cadoles_core_config_logo")!==false) $route="cadoles_portal_config_page";
|
||||
if(stripos($route,"cadoles_core_config_header")!==false) $route="cadoles_portal_config_page";
|
||||
|
||||
@ -133,7 +132,6 @@
|
||||
$route.=(isset($tbroute[1])?"_".$tbroute[1]:"");
|
||||
$route.=(isset($tbroute[2])?"_".$tbroute[2]:"");
|
||||
$route.=(isset($tbroute[3])?"_".$tbroute[3]:"");
|
||||
error_log($route);
|
||||
|
||||
$permmodo = $this->em->getRepository("CadolesCoreBundle:PermModo")->findOneBy(['route'=> $route, "visible"=>true]);
|
||||
if(!$permmodo) die('Permission denied');
|
||||
|
Loading…
Reference in New Issue
Block a user