Explorar el Código

Hide the "delete" option if that capability is not granted.

Michel Weimerskirch hace 13 años
padre
commit
b260330372
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Form/Type/AdminType.php

+ 1 - 1
Form/Type/AdminType.php

@@ -27,7 +27,7 @@ class AdminType extends AbstractType
     public function buildForm(FormBuilder $builder, array $options)
     {
         $admin = $this->getAdmin($options);
-        if ($options['delete']) {
+        if ($options['delete'] && $admin->isGranted('DELETE') ) {
             $builder->add('_delete', 'checkbox', array('required' => false, 'property_path' => false));
         }