Browse Source

Merge pull request #503 from Samffy/patch-1

Add a check on delete route for batch action
Thomas 13 năm trước cách đây
mục cha
commit
e85d34c2c3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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