Added permission to control who can access label scanner.

This commit is contained in:
Jan Böhmer 2020-05-08 12:50:44 +02:00
parent 1f48247474
commit 9a9cd8e887
4 changed files with 18 additions and 9 deletions

View file

@ -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;
}