mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-20 19:05:14 +02:00
Merge branch '2fa' into master
This commit is contained in:
commit
1016f0d4ee
65 changed files with 4769 additions and 320 deletions
|
@ -23,12 +23,22 @@ namespace App\Form\AdminPages;
|
|||
|
||||
use App\Entity\Base\NamedDBElement;
|
||||
use App\Form\Permissions\PermissionsType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class GroupAdminForm extends BaseEntityAdminForm
|
||||
{
|
||||
protected function additionalFormElements(FormBuilderInterface $builder, array $options, NamedDBElement $entity)
|
||||
{
|
||||
$is_new = null === $entity->getID();
|
||||
|
||||
$builder->add('enforce2FA', CheckboxType::class, ['required' => false,
|
||||
'label' => 'group.edit.enforce_2fa',
|
||||
'help' => 'entity.edit.enforce_2fa.help',
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)
|
||||
]);
|
||||
|
||||
$builder->add('permissions', PermissionsType::class, [
|
||||
'mapped' => false,
|
||||
'data' => $builder->getData(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue