Bladeren bron

Fix chequeo de roles

Espinoza Guillermo 6 jaren geleden
bovenliggende
commit
a929fd734f
1 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  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');