Policy to check user belongs to team
Hi, there! Noob question: I want to check if this user belongs to the team which owns the site so the user can select/update etc. I have a Sites table with a "team" property (foreign key to Team id), Teams table, and finally a Members table, with "user_id" and "team". I can't seem to find any good example on creating a policy which looks up "Members" to check whether the currently logged in user belongs to the team which is referenced in the "team" property.
My feeble attempt does not work:
Do I have to INNER JOIN?
My feeble attempt does not work:
Do I have to INNER JOIN?