Browse Source

Merge pull request #521 from mweimerskirch/patch-4

Hide the "delete" option if that capability is not granted
Thomas 13 years ago
parent
commit
7a7c4b8d26
1 changed files with 1 additions and 1 deletions
  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));
         }