victorious-eye-56567
05/16/2023, 11:47 AMtraverse
function in my Keto OPL files.
Here are the permissions:
export class User implements Namespace {}
export class UserList implements Namespace {
related: {
members: User[]
community: Community[]
}
permits = {
view: (ctx: Context): boolean => this.related.community.traverse((c) => c.permits.view(ctx)),
add_member: (ctx: Context): boolean =>
this.related.community.traverse((c) => c.related.user_list_managers.includes(ctx.subject)),
remove_member: (ctx: Context): boolean =>
this.related.community.traverse((c) => c.related.user_list_managers.includes(ctx.subject)),
}
}
export class Community implements Namespace {
related: {
members: (User | SubjectSet<UserList, "members">)[]
user_list_managers: (User | SubjectSet<UserList, "members">)[]
}
permits = {
view: (ctx: Context): boolean => this.related.members.includes(ctx.subject),
create_user_list: (ctx: Context): boolean => this.related.user_list_managers.includes(ctx.subject),
}
}
My issue is that when using the Ory Network I can make it work and get allowed when intended (checking add_member
for example)
But when I use the self hosted version of Keto and I create exactly the same relations using the API I get “denied” instead of allowed.
What am I doing wrong ? Is there an issue with how I use traverse ? Or maybe with how I create relations ?
I put my Ory Network relations and my database relations in thread for comparison.victorious-eye-56567
05/16/2023, 11:47 AMvictorious-eye-56567
05/16/2023, 11:48 AMf809a71d-0daf-4b7f-8a16-7430b2b7bd70 a4016bc5-f5a6-4123-bfef-6f9753afd0d6 UserList 512a2e45-39fc-56cd-a191-cf70e5872bd9 community ce303a97-30e4-58ae-a6e0-5c3d711b62bf 2023-05-16 11:32:10.478931
77352afa-c930-4b2e-bc55-05bd9ded1983 a4016bc5-f5a6-4123-bfef-6f9753afd0d6 UserList 512a2e45-39fc-56cd-a191-cf70e5872bd9 members b57102bb-c3df-5d62-ae6e-c5f2eb5c9544 2023-05-16 11:31:56.951067
ab097804-dcc3-471a-8c0e-d5e1f0359193 a4016bc5-f5a6-4123-bfef-6f9753afd0d6 Community ce303a97-30e4-58ae-a6e0-5c3d711b62bf user_list_managers UserList 512a2e45-39fc-56cd-a191-cf70e5872bd9 members 2023-05-16 11:31:24.638526
f2b80112-4a4c-4c8e-a554-cf9470af7734 a4016bc5-f5a6-4123-bfef-6f9753afd0d6 Community ce303a97-30e4-58ae-a6e0-5c3d711b62bf members UserList 512a2e45-39fc-56cd-a191-cf70e5872bd9 members 2023-05-16 11:31:08.199593
victorious-eye-56567
05/16/2023, 11:50 AMvictorious-eye-56567
05/16/2023, 12:14 PMmax_read_depth
in keto config from 1 to 4 with no success.shy-beach-55709
06/01/2023, 6:30 PM