Browse Source

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

Michel Weimerskirch 13 năm trước cách đây
mục cha
commit
b260330372
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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));
         }