Check that user has general access rights to partdb

See #1283
This commit is contained in:
Jan Böhmer 2026-03-04 23:37:59 +01:00
parent f15979ed11
commit af6ddffa1d

View file

@ -71,7 +71,10 @@ class TypeaheadController extends AbstractController
#[Route(path: '/builtInResources/search', name: 'typeahead_builtInRessources')]
public function builtInResources(Request $request, BuiltinAttachmentsFinder $finder): JsonResponse
{
$query = $request->get('query');
//Ensure that the user can access Part-DB at all
$this->denyAccessUnlessGranted('HAS_ACCESS_PERMISSIONS');
$query = $request->query->getString('query');
$array = $finder->find($query);
$result = [];