nestjsx / crud

NestJs CRUD for RESTful APIs
https://github.com/nestjsx/crud/wiki
MIT License
4.04k stars 533 forks source link

CrudAuth nested filter #732

Open vladi-strilets opened 3 years ago

vladi-strilets commented 3 years ago

Is it possible to use a nested filter inside @CrudAuth ?

For example;

I have this relations: Projects - N:1 - Client - 1:1 - User

My crud looks like this:

@Crud({
  model: {
    type: Project,
  },
  routes: {
    only: ['getManyBase'],
  },
})
@CrudAuth({
  filter: (user: User) => {
    return { 'client.user.id': user.id };
  },
})

Thanks

BenStirrup commented 2 years ago

Same question here ! Does someone has the answer ?