mysterious-processor-51766
05/18/2024, 9:43 AMclass Company implements Namespace {
related: {
admins: User[]
}
permits = {
owner: (ctx: Context): boolean =>
this.related.admins.includes(ctx.subject)
}
}
class LearningPlan implements Namespace {
related: {
owners: User[]
companies: Company[]
}
permits = {
owner: (ctx: Context): boolean =>
this.related.companies.traverse((parent) => parent.permits.owner(ctx)) ||
this.related.owners.includes(ctx.subject)
}
}
With these relations:
• Subject companies/simpleclub
is companies
of Object LearningPlan:learning_plans/xyz
• Subject users/abc
is admins
of Object Company:companies/simpleclub
Why does this request https://{project-slug}.<http://projects.oryapis.com/relation-tuples/checknamespace=LearningPlan&object=learning_plans/xyz&relation=owner&subject_id=users/abc&max-depth=20|projects.oryapis.com/relation-tuples/checknamespace=LearningPlan&object=learning_plans/xyz&relation=owner&subject_id=users/abc&max-depth=20>
return {"allowed": false}
chilly-king-10285
05/18/2024, 9:44 AMchilly-king-10285
05/18/2024, 9:44 AM