Example #1
0
 public function execute(BlockContextInterface $blockContext, Response $response = null)
 {
     // merge settings
     $settings = array_merge($this->getDefaultSettings(), $blockContext->getSettings());
     $curBlock = 'SuppliercheckAdminBundle:Block:block_importCSV.html.twig';
     if (!$this->container->get('security.context')->isGranted("ROLE_SUPER_ADMIN")) {
         $curBlock = 'SuppliercheckAdminBundle:Block:block_empty.html.twig';
     }
     return $this->renderResponse($curBlock, array('block' => $blockContext->getBlock(), 'allTypes' => CSVTypes::getTypesAndIds(), 'settings' => $settings), $response);
 }