Show a notice above the permission editor, that permissions can depend on each other

Related to issue #435
This commit is contained in:
Jan Böhmer 2023-11-25 00:42:17 +01:00
parent 84c111ac7c
commit 4b88de9316
3 changed files with 14 additions and 0 deletions

View file

@ -45,6 +45,9 @@ class PermissionsType extends AbstractType
$resolver->setDefaults([
'show_legend' => true,
'show_presets' => false,
'show_dependency_notice' => static function (Options $options) {
return !$options['disabled'];
},
'constraints' => static function (Options $options) {
if (!$options['disabled']) {
return [new NoLockout()];
@ -60,6 +63,7 @@ class PermissionsType extends AbstractType
{
$view->vars['show_legend'] = $options['show_legend'];
$view->vars['show_presets'] = $options['show_presets'];
$view->vars['show_dependency_notice'] = $options['show_dependency_notice'];
}
public function buildForm(FormBuilderInterface $builder, array $options): void