mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-02 22:44:33 +02:00
Show legend for permission values.
This commit is contained in:
parent
35dd1fabc0
commit
e7a95926f6
2 changed files with 37 additions and 0 deletions
|
@ -35,6 +35,9 @@ namespace App\Form\Permissions;
|
|||
use App\Services\PermissionResolver;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PermissionsType extends AbstractType
|
||||
{
|
||||
|
@ -48,6 +51,18 @@ class PermissionsType extends AbstractType
|
|||
}
|
||||
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'show_legend' => true
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['show_legend'] = $options['show_legend'];
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$groups = $this->perm_structure['groups'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue