瀏覽代碼

Fix chequeo de roles

Espinoza Guillermo 6 年之前
父節點
當前提交
a929fd734f
共有 1 個文件被更改,包括 4 次插入2 次删除
  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');