Hey all,
We have a scenario where we are protecting payers, policies and beneficiaries.
A payer can view its policies and the beneficiaries under those policies, kind of top to bottom permission, so far so good..
Here is a snippet of the schema with testing relationships and assertions:
https://play.authzed.com/s/GjA91LiSJ9ZB/schema
But now beneficiaries need to have permission to view the policy that he belongs to and the payer of that policy (kind of bottom up).
We've modeled the permission schema by adding relations both ways and tweaking the permission (which felt kind of cumbersome) and I wondering if this is the ideal way to model it.
Here is the snippet of the schema having relations both ways:
https://play.authzed.com/s/fL2h2Ag8sbpB/schema
Any thoughts?