Closed
Description
Case 1:
model User {
id Int @id @default(autoincrement())
company Company[]
test Int
// "this.test" should trigger an error, but it's incorrectly resolved to `User.test`
@@allow('read', auth().company?[staff?[companyId == this.test]])
}
model Company {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
staff Staff[]
@@allow('read', true)
}
model Staff {
id Int @id @default(autoincrement())
company Company @relation(fields: [companyId], references: [id])
companyId Int
@@allow('read', true)
}
Case 2:
model User {
id Int @id @default(autoincrement())
company Company[]
test Int
// "test" should trigger an error, but it's incorrectly resolved to `User.test`
@@allow('read', auth().company?[staff?[companyId == test]])
}
model Company {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId Int
staff Staff[]
@@allow('read', true)
}
model Staff {
id Int @id @default(autoincrement())
company Company @relation(fields: [companyId], references: [id])
companyId Int
@@allow('read', true)
}
Metadata
Metadata
Assignees
Labels
No labels