mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 09:53:35 +02:00
Added permission system, to control who can edit Twig labels.
This commit is contained in:
parent
f1a6bc31a1
commit
1a35adab17
6 changed files with 41 additions and 8 deletions
|
@ -87,7 +87,12 @@ class LabelController extends AbstractController
|
|||
$label_options = new LabelOptions();
|
||||
}
|
||||
|
||||
$form = $this->createForm(LabelDialogType::class);
|
||||
//We have to disable the options, if twig mode is selected and user is not allowed to use it.
|
||||
$disable_options = $label_options->getLinesMode() === 'twig' && !$this->isGranted("@labels.use_twig");
|
||||
|
||||
$form = $this->createForm(LabelDialogType::class, null, [
|
||||
'disable_options' => $disable_options,
|
||||
]);
|
||||
|
||||
//Try to parse given target_type and target_id
|
||||
$target_type = $request->query->get('target_type', null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue