Hello, we need some use-case/schema
# spicedb
p
Hello, we need some use-case/schema modelling assistance - We're trying to model a sort-of-attribute-based authz with our existing SpiceDB Schema. We looked at the ABAC guide here - https://authzed.com/docs/spicedb/modeling/attributes and while it would work for some of our cases (not all), it seems like the recommended way to do it is via Caveats. We need to be able to give permissions to a resource(A) in a few ways 1. Only if a 'setting' is enabled in a related resource(B). 2. Only if a certain condition (ideally sent in the caveat context) in the related resource(B) is true The problem we're running into is that caveats seem to be defined only against relations and not permissions. With that constraint, we cannot use the same relation across multiple permissions, only some of which might require that caveat. I've made a small reproducible schema with comments on what we're stuck on - https://play.authzed.com/s/C2CfvNEhS2mj/schema Any help/alternative ways to achieve what we want would be highly appreciated!
y
you can write a relation like this:
Copy code
relation member: user | user with is_setting_enabled
if that would suffice. otherwise you'd have to split the relation up and then use unions in the permissions to define the different paths by which a user could receive the perm.
p
ahh the second one is what we were trying to avoid, as it would essentially increase the number of relations we have to add and maintain to N+1 times the number of distinct caveated permissions we have
12 Views