Skip to content

Commit

Permalink
Fix delete permission for AdminType
Browse files Browse the repository at this point in the history
- Now the `delete` attribute can be voted on wit a specific subject
  • Loading branch information
Timon committed Aug 13, 2024
1 parent 73492af commit 338c96f
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 338c96f

Please sign in to comment.