mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 04:30:08 +02:00
Disable parameters fields when user is not allowed to edit data structures.
This commit is contained in:
parent
6841f91ab5
commit
e72fc2716b
2 changed files with 5 additions and 4 deletions
|
@ -156,11 +156,12 @@ class BaseEntityAdminForm extends AbstractType
|
|||
|
||||
$builder->add('parameters', CollectionType::class, [
|
||||
'entry_type' => ParameterType::class,
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'allow_add' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
'allow_delete' => $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
'label' => false,
|
||||
'by_reference' => false,
|
||||
'prototype_data' => new $options['parameter_class'],
|
||||
'prototype_data' => new $options['parameter_class'](),
|
||||
'entry_options' => [
|
||||
'data_class' => $options['parameter_class'],
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue