For example, I have entities like Photo, Company, Car, etc. I know that they have columns with same names and I can access it via QueryBuilder. I don't know which repository I will process, but it's passed like string parameter to my function. Like this:
function haveAccess(user, entity, entityId) {
// model is string like 'photo', 'company', 'car'
}
In fact, I want to check if user have access to the entity with given ID via separate function not binded to just one Entity.
Is it possible to initialize Repository or QueryBuilder for Entity in TypeORM just by string somehow?