瀏覽代碼

Merge pull request #521 from mweimerskirch/patch-4

Hide the "delete" option if that capability is not granted
Thomas 13 年之前
父節點
當前提交
7a7c4b8d26
共有 1 個文件被更改,包括 1 次插入1 次删除
  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));
         }