best-tent-33082
02/21/2023, 3:39 PMexpected ")", got "||"
. This error is incorrect, the typescript is properly formatted and there is no syntax error. So, I'm confused why this is happening.
My input:
import { Namespace, Context } from "@ory/permission-namespace-types"
class Organization implements Namespace {
related: {
member: Member[]
manager: Member[]
}
permits = {
view: (ctx: Context): boolean =>
this.related.manager.includes(ctx.subject) ||
this.related.member.includes(ctx.subject),
edit: (ctx: Context): boolean =>
this.related.manager.includes(ctx.subject),
}
}
class Member implements Namespace {
related: {
manager: Member[]
organization: Organization[]
}
permits = {
view: (ctx: Context): boolean =>
this.related.organization.traverse(
(o) =>
o.related.manager.includes(ctx.subject) ||
o.related.member.includes(ctx.subject)
),
edit: (ctx: Context): boolean =>
this.related.manager.includes(ctx.subject) ||
this.related.organization.traverse(
(o) => o.related.manager.includes(ctx.subject)
),
deactivate: (ctx: Context): boolean =>
this.related.organization.traverse(
(o) => o.related.manager.includes(ctx.subject)
),
}
}
steep-lamp-91158
steep-lamp-91158
this.related.organization.traverse((o) => o.related.manager.includes(ctx.subject)) || this.related.organization.traverse((o) => o.related.member.includes(ctx.subject)),
best-tent-33082
02/21/2023, 4:02 PMsteep-lamp-91158
steep-lamp-91158
best-tent-33082
02/21/2023, 4:05 PMsteep-lamp-91158
steep-lamp-91158
steep-lamp-91158
steep-lamp-91158
If you can make sense of bad documentation effectively, you're already better than 90% of engineers.😅
best-tent-33082
02/21/2023, 4:15 PMsteep-lamp-91158