diff --git a/src/Form/Type/AdminType.php b/src/Form/Type/AdminType.php index 07946c1aab..12fab0fad0 100644 --- a/src/Form/Type/AdminType.php +++ b/src/Form/Type/AdminType.php @@ -45,7 +45,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $admin->getParentFieldDescription()->setAssociationAdmin($admin); } - if (true === $options['delete'] && $admin->hasAccess('delete')) { + if (true === $options['delete'] && $admin->hasAccess('delete', $builder->getData())) { $deleteOptions = $options['delete_options']; if (!\array_key_exists('translation_domain', $deleteOptions['type_options'])) { $deleteOptions['type_options']['translation_domain'] = $admin->getTranslationDomain();