Skip to content

Compiler should throw error for access array member inside of auth() function #756

Closed
@jiashengguo

Description

@jiashengguo

It should throw an error for the below policy:

model User {
  id Int @id @default(autoincrement())
  email Int
  posts Post[]
}

model Post {
  id Int @id @default(autoincrement())
  author User? @relation(fields: [authorId], references: [id])
  authorId Int
  @@allow('all', auth().posts.authorId == authorId)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions