Hi guys. I have question how to get know the curre...
# spicedb
k
Hi guys. I have question how to get know the current access level for a child resource? Let's say I have folders like in Google Drive. Parent folder set organization level as Editor, and child folder inherits this access from parent. In the database I have following structure, for parent folder I set
organization_access: 'editor'
, but for child folder I set
organization_access: null
to indicate that child folder inherits access from parent folder. But on the frontend, I must always display the current access for each child folder regardless of their nested level. I know that it's best practice to create different granular permissions, like
canAdd
,
canUpdate
, etc, but this evaluates only to current subject, but I have another column
public_access
that works in the same way as
organization_access
. In this case I need to return both columns for one subject, for organization member or public users. What's the best and recommended way to evaluate the access level inherited from parent folder? This task looks very close to Expand API, but this seems to be very heavy operation and I'm wondering is there any better option? Thanks!