how to hide records with specific conditions in symfony (admin ..)

Hi everyone,
I have implemented the Algolia search system (Symfony version) in a symfony application.
The display and the search are working fine.
The application works with a hierarchy, an administrator can see all the records, a simple user cannot.
The problem is, I don’t know how to filter the records by role.
I have already tried to send the id of the records in my JS (files that render the records in my twig), but I don’t have the hand on all the rendering of the different elements.
I may have missed a feature, that’s why I created this topic. Thanks in advance !