Is it possible to use req.options.where
with associations that are more then one level?
If so how?
If not, what is the 'correct way' to go about creating a policy for the following scenario.
I have 3 models User Parent Child
I have the vanilla blueprint actions for all the models.
Children have parents and parents have users.
In my policy I would like to add to the request; the instructions to only return Children of a particular user.
Hopefully it will be similar to the following:
For a Parent request
req.options.where.user = req.session.current_user_id
I am not using 'populate where' functionality of blueprint for this scenario.
Presently, when some one hits the child find action, it displays all the children. I am trying to just allow them to see children of the logged in user.
Any help would be greatly appreciated.