Explorar el Código

Fix chequeo de roles

Espinoza Guillermo hace 6 años
padre
commit
a929fd734f
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      Controller/CRUDController.php

+ 4 - 2
Controller/CRUDController.php

@@ -176,8 +176,10 @@ class CRUDController extends BaseCRUDController
      */
     public function runWorkflowBatchAction($workflow, ProxyQueryInterface $selectedModelQuery)
     {
-        if ($this->admin->isGranted('EDIT') === false || $this->admin->isGranted('DELETE') === false) {
-            throw new AccessDeniedException();
+        if ($this->isGranted('ROLE_SUPER_ADMIN') === false && 
+            $this->admin->isGranted('EDIT') === false && 
+            $this->admin->isGranted('DELETE') === false) {
+                throw $this->createAccessDeniedException('You cannot access this page!');
         }
         $session = $this->get('session')->getFlashBag();
         $translator = $this->get('translator');