mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-19 10:24:50 +02:00
Added various useful presets for permissions
This commit is contained in:
parent
5829d42968
commit
1de88e0494
13 changed files with 369 additions and 231 deletions
|
@ -64,6 +64,7 @@ class GroupAdminForm extends BaseEntityAdminForm
|
|||
'mapped' => false,
|
||||
'data' => $builder->getData(),
|
||||
'disabled' => !$this->security->isGranted('edit_permissions', $entity),
|
||||
'show_presets' => $this->security->isGranted('edit_permissions', $entity) && !$is_new,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ class PermissionsType extends AbstractType
|
|||
{
|
||||
$resolver->setDefaults([
|
||||
'show_legend' => true,
|
||||
'show_presets' => false,
|
||||
'constraints' => static function (Options $options) {
|
||||
if (!$options['disabled']) {
|
||||
return [new NoLockout()];
|
||||
|
@ -80,6 +81,7 @@ class PermissionsType extends AbstractType
|
|||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
{
|
||||
$view->vars['show_legend'] = $options['show_legend'];
|
||||
$view->vars['show_presets'] = $options['show_presets'];
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
|
|
|
@ -227,6 +227,7 @@ class UserAdminForm extends AbstractType
|
|||
'mapped' => false,
|
||||
'data' => $builder->getData(),
|
||||
'disabled' => !$this->security->isGranted('edit_permissions', $entity),
|
||||
'show_presets' => $this->security->isGranted('edit_permissions', $entity) && !$is_new,
|
||||
])
|
||||
;
|
||||
/*->add('comment', CKEditorType::class, ['required' => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue