average-policeman-69189
03/15/2023, 8:41 PMclass Product implements Namespace {
related: {
parents: Team[]
}
permits = {
view: (ctx: Context): boolean =>
this.permits.edit(ctx) ||
this.related.parents.traverse((p) => p.related.guests.includes(ctx.subject)),
edit: (ctx: Context): boolean =>
this.permits.delete(ctx) ||
this.related.parents.traverse((p) => p.related.members.includes(ctx.subject) || p.related.managers.includes(ctx.subject)),
delete: (ctx: Context): boolean =>
this.related.parents.traverse((p) => p.related.owners.includes(ctx.subject)) ||
this.related.parents.traverse((p) => p.related.operators.includes(ctx.subject))
}
}
The synthax is not accepted for the permits.edit ... I'm forced to do a duplicate traverse. Do you think this will change in the future ? It's a bug or missing feature in the Permission Language ? Thankssteep-lamp-91158
steep-lamp-91158