Hey all,
# spicedb
d
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?
v
Hi 👋 AFAIK there is no way around it, the traversal path needs to exist. We have an issue filed describing "a reverse relation": https://github.com/authzed/spicedb/issues/356
c
How does this not create uncomputable cycles? I tried something similar, but anytime I try to check any permissions, I get an error because the recursion depth is too big.
v
you need to craft the traversal path in a way that does not lead to these cycles. It may involve adding new relations and permissions
2 Views