mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Added permissions to label system.
This commit is contained in:
parent
fde1d7be4f
commit
5a9be023b1
6 changed files with 62 additions and 27 deletions
|
@ -29,9 +29,17 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class LabelDialogType extends AbstractType
|
||||
{
|
||||
protected $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('target_id', TextType::class, [
|
||||
|
@ -45,6 +53,8 @@ class LabelDialogType extends AbstractType
|
|||
|
||||
$builder->add('options', LabelOptionsType::class, [
|
||||
'label' => false,
|
||||
'disabled' => !$this->security->isGranted('@labels.edit_options'),
|
||||
|
||||
]);
|
||||
$builder->add('update', SubmitType::class, [
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue