mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Hide "Show all entry" in tools sidebar if user does not have permissions to view parts.
This commit is contained in:
parent
34fbcec00f
commit
06ae136bae
1 changed files with 7 additions and 4 deletions
|
@ -242,10 +242,13 @@ class ToolsTreeBuilder
|
||||||
protected function getShowNodes(): array
|
protected function getShowNodes(): array
|
||||||
{
|
{
|
||||||
$show_nodes = [];
|
$show_nodes = [];
|
||||||
|
|
||||||
|
if ($this->security->isGranted('@parts.read')) {
|
||||||
$show_nodes[] = (new TreeViewNode(
|
$show_nodes[] = (new TreeViewNode(
|
||||||
$this->translator->trans('tree.tools.show.all_parts'),
|
$this->translator->trans('tree.tools.show.all_parts'),
|
||||||
$this->urlGenerator->generate('parts_show_all')
|
$this->urlGenerator->generate('parts_show_all')
|
||||||
))->setIcon('fa-fw fa-treeview fa-solid fa-globe');
|
))->setIcon('fa-fw fa-treeview fa-solid fa-globe');
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->security->isGranted('@attachments.list_attachments')) {
|
if ($this->security->isGranted('@attachments.list_attachments')) {
|
||||||
$show_nodes[] = (new TreeViewNode(
|
$show_nodes[] = (new TreeViewNode(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue