Understanding subject-set rewrites and the graph of relations #765
-
Hey all! I've been reading through the Ory Keto documentation, and I've been particularly interested in the Graph of Relations page and the general guidance around Subjects. I also spent some time with the Zanzibar paper for a conceptual overview. I have a few questions I haven't been able to answer for myself:
I'm trying to sketch out how I might use Keto to say "this item belongs to this group" and "for any item in this group, these people should have these permissions". The particular set of people is bound to change over time, and I would want to make that change centrally without having to revisit the permissions for all items in the group. I'd appreciate any insight or references you can give! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
It is important to distinguish subject-sets and subject-set-rewrites here. The former are supported by Keto, while the latter are not yet implemented. The examples you provided all contain subject-sets and are regular relationtuples. Subject-set-rewrites are a global configuration that works a bit like an instruction to define tuples that are not actually stored, but deducted from the stored ones. The most straight forward example (from the zanzibar paper): relation: {
name: "editor"
userset_rewrite: {
union: {
child: { _this: {} }
child: { computed_userset: { relation: "owner" } }
} } } This means that for each tuple of the format Until subject-set-rewrites are supported by Keto, you can as a workaround construct the relationtuples that would be defined through the rewrite, and actually store them in Keto. That is not really scalable, but works for the beginning. An example for above rewrite is that on every API call that adds an The empty relation is just a special relation that allows you to use objects as subjects, therefore defining a relation between two objects. What that actually means has to be defined through subject-sets or -rewrites. Answering your question: it only establishes a link and no inheritance. Regarding your example, I would currently model it with the following relationtuples:
but it will be much nicer with subject-set-rewrites, as you will be able to use the empty relation to establish the link between items and groups instead. |
Beta Was this translation helpful? Give feedback.
-
Hi @zepatrik, |
Beta Was this translation helpful? Give feedback.
It is important to distinguish subject-sets and subject-set-rewrites here. The former are supported by Keto, while the latter are not yet implemented. The examples you provided all contain subject-sets and are regular relationtuples.
Subject-set-rewrites are a global configuration that works a bit like an instruction to define tuples that are not actually stored, but deducted from the stored ones. The most straight forward example (from the zanzibar paper):
This means that for each tuple of the format
<object>#owner@<subject>
, the system …