Explorar o código

Add a check on delete route for batch action

Samffy %!s(int64=13) %!d(string=hai) anos
pai
achega
a3b8a9df1e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Admin/Admin.php

+ 1 - 1
Admin/Admin.php

@@ -788,7 +788,7 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     {
         $actions = array();
 
-        if ($this->isGranted('DELETE')) {
+        if ($this->hasRoute('delete') && $this->isGranted('DELETE')) {
             $actions['delete'] = array(
                 'label' => $this->trans('action_delete', array(), 'SonataAdminBundle'),
                 'ask_confirmation' => true, // by default always true