Hey there, is there a "cheap" way of
# spicedb
s
Hey there, is there a "cheap" way of getting the whole permissions tree for a particular subject with a specific relation? We are mostly interested in the roots. E.g. in a folder structure we want to display only folders a user has read permissions and as we can give access to a folder anywhere within that folder tree that particular folder might become a root folder for that particular user as he cannot see everything above. How can we easily get these "roots" without actually keeping a user specific tree seperately if even possible?
v
Right now there is no API for returning permissions while keeping some notion of structure. You can use
LookupResources
to get "all the folders the user has
view
access on. You'll have to do the filtering yourself. Then there is the
Expand
API, which let's you expand the relationships (not the permissions) that connect with a specific resource. It gives you the structure, and you could eventually infer the permissions, but it does not recurse - so you have to recursively expand yourself
2 Views