mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 04:08:57 +02:00
Added permission to control who can access label scanner.
This commit is contained in:
parent
1f48247474
commit
9a9cd8e887
4 changed files with 18 additions and 9 deletions
|
@ -118,17 +118,19 @@ class ToolsTreeBuilder
|
|||
{
|
||||
$nodes = [];
|
||||
|
||||
if($this->security->isGranted('@labels.create_labels')) {
|
||||
if ($this->security->isGranted('@labels.create_labels')) {
|
||||
$nodes[] = new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.tools.label_dialog'),
|
||||
$this->urlGenerator->generate('label_dialog')
|
||||
);
|
||||
}
|
||||
|
||||
$nodes[] = new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.tools.label_scanner'),
|
||||
$this->urlGenerator->generate('scan_dialog')
|
||||
);
|
||||
if ($this->security->isGranted('@tools.label_scanner')) {
|
||||
$nodes[] = new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.tools.label_scanner'),
|
||||
$this->urlGenerator->generate('scan_dialog')
|
||||
);
|
||||
}
|
||||
|
||||
return $nodes;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue