Added the IC logos tools from the old Part-DB version

This commit is contained in:
Jan Böhmer 2023-01-12 00:14:31 +01:00
parent d734df4bd3
commit 769850cec6
7 changed files with 466 additions and 2 deletions

View file

@ -111,4 +111,15 @@ class ToolsController extends AbstractController
'grouped_footprints' => $grouped_footprints,
]);
}
/**
* @Route("/ic_logos", name="tools_ic_logos")
* @return Response
*/
public function icLogos(): Response
{
$this->denyAccessUnlessGranted('@tools.ic_logos');
return $this->render('Tools/ICLogos/ic_logos.html.twig');
}
}

View file

@ -137,6 +137,12 @@ class ToolsTreeBuilder
$this->urlGenerator->generate('tools_builtin_footprints_viewer')
))->setIcon('fa-treeview fa-fw fa-solid fa-images');
}
if ($this->security->isGranted('@tools.ic_logos')) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('perm.tools.ic_logos'),
$this->urlGenerator->generate('tools_ic_logos')
))->setIcon('fa-treeview fa-fw fa-solid fa-flag');
}
return $nodes;
}

View file

@ -140,6 +140,7 @@ class PermissionPresetsHelper
$this->permissionResolver->setPermission($perm_holder, 'tools', 'label_scanner', PermissionData::ALLOW);
$this->permissionResolver->setPermission($perm_holder, 'tools', 'reel_calculator', PermissionData::ALLOW);
$this->permissionResolver->setPermission($perm_holder, 'tools', 'builtin_footprints_viewer', PermissionData::ALLOW);
$this->permissionResolver->setPermission($perm_holder, 'tools', 'ic_logos', PermissionData::ALLOW);
//Set attachments permissions
$this->permissionResolver->setPermission($perm_holder, 'attachments', 'list_attachments', PermissionData::ALLOW);