Disable attachments form if user is not allowed to edit the element.

This commit is contained in:
Jan Böhmer 2019-09-24 18:41:53 +02:00
parent 67fe47bbb9
commit 2e318f9ea1
2 changed files with 3 additions and 1 deletions

View file

@ -109,6 +109,7 @@ class BaseEntityAdminForm extends AbstractType
'allow_add' => true,
'allow_delete' => true,
'label' => false,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
'entry_options' => [
'data_class' => $options['attachment_class'],
],

View file

@ -198,7 +198,8 @@ class UserAdminForm extends AbstractType
'entry_options' => [
'data_class' => $options['attachment_class'],
],
'by_reference' => false
'by_reference' => false,
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
]);
//Buttons