nestjsx / crud

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

Purpose of the CrudAuth decorator #324

Open DaVarga opened 4 years ago

DaVarga commented 4 years ago

First of all thank you for this great software. I have a question about the new CrudAuth decorator I am not sure if it works the way it should.

Let's say I have an entity Gallery which has a list of User called allowedUsers. I would configure the CrudAuth decorator as follows:

@CrudAuth({
  filter: (req) => ({'allowedUsers.id': req.user.id})
})

getMany works as expected. I only get the corresponding galleries. getOne in combination with ?join=allowedUsers however only returns my user relation even if there are others. Is that the desired behavior?

michaelyali commented 4 years ago

Sorry for the late response. Could you please provide a generated SQL?