소스 검색

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

Michel Weimerskirch 13 년 전
부모
커밋
b260330372
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));
         }