User defined roles & their instances in multi-tena...
# spicedb
v
I have setup my schema following the guide on user-defined roles. What I imagine is the app providing: 1. some default roles out of the box 2. users creating roles they can reuse across projects
The question is about how to do reuse correctly. For example, a role has a set of permissions defined, but is not connected to any resources until an instance is realized. - they cannot exist in spicedb yet, recorded in traditional db? - each time a user makes use of it within a scope, like a project or folder - they have to be independent, because they can apply to different resources or subjects, depending on scope - my backend logic would load the role definition and loop over the permissions, making many writes to spicedb - my backend logic would need to track changes to the role definition and roll them out (potentially widely) to all the instances - these updates would need something like a diff or reconciliation incase a permission was removed does this sound about right?
y
it depends on which model you're using. i've found that the google cloud iam-ish model does the best job of separating the question of "what permissions" from "which objects" at the expense of a bit more schema complexity. which model are you basing your setup on?
v
I'm not using the role_grant as seen in the Google IAM-ish post
y
gotcha. yeah, ime the google cloud iamish post approach is best when you want to change what the definition of a role means in one place and have it apply to all instances of that role - otherwise any change to the definition of a role is going to functionally require a data migration, at least as far as i understand it.
v
yeah, that sounds about right, but I don't expect those to change often, and/or can build reconciliation into the process over making the schema more complex. It can come down to tradeoff analysis, yea?
y
yeah, definitely
55 Views