Does ory keto support subgroups? Like A group link...
# general
c
Does ory keto support subgroups? Like A group linked to B group where B inherits A's permissions
l
Yes you could model your groups as a tree where each group could have parent groups and do something like
Copy code
class User implements Namespace {}

class Group implements Namespace {
  related: {
    parents: Group[];
    members: User[];
  };

  permits = {
    view: (ctx: Context): boolean => this.related.members.includes(ctx.subject)
        || this.related.parents.traverse(group => group.permits.view(ctx));
  };
}
1
c
Thank you
@lively-scientist-17848 what if I want it to inherit all the permissions from A to B?