I need help please
I've had a problem for a few days now.
I have an EasyAdmin with many users, but each user should only be able to create or edit their own data records.
Creating a record for a user is not a problem. But the display only of the user record in INDEX so that he can only edit his records
As an an example:
A user can have many hostels with many room_types.
If the user now displays the Crud :: INDEX page of room_types. Should he only be shown room_types with his hostel_id.
I despair of that

You can override the createIndexQueryBuilder function in your crud controller so that it only shows the records he's entitled to
Thank you for your answer.
I always thought of this function. But I have always focused too much on what comes into the function for objects. Instead of thinking about what is supposed to get out
it works thanks
public function createIndexQueryBuilder(
SearchDto $searchDto,
EntityDto $entityDto,
FieldCollection $fields,
FilterCollection $filters
): QueryBuilder {
$test = $this->get(EntityRepository::class)->createQueryBuilder($searchDto, $entityDto, $fields, $filters);
$alias = $test->getRootAliases();
$test->andWhere($alias[0].'.user_id = 4');
return $test;
}