Skip to content

Commit

Permalink
Fix delete permission for AdminType (#8200)
Browse files Browse the repository at this point in the history
Co-authored-by: Timon <[email protected]>
  • Loading branch information
DenuxPlays and Timon authored Nov 14, 2024
1 parent 9579fc2 commit 67b39f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form/Type/AdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 67b39f0

Please sign in to comment.