Skip to content

Field-level read policy should filter out the unmet data returned from findMany if the field is used in the filter #1644

@jiashengguo

Description

@jiashengguo
model User {
    id       Int    @id @default(autoincrement())
    email    String @unique @email @length(6, 32) @allow('read', auth() == this)

    // full access to all
    @@allow('all', true)
}
  • current
// count returns 1 correctly
db.user.count({ where: { email: { contains: 'web.com' } } };

// It returns all users, but only shows the email for current user.
db.user.findMany({ where: { email: { contains: 'web.com' } } })
  • expected
    findMany should also return one record same as count.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions