Skip to content

[Bug] Rules with !auth().someBool causes failure #1941

Open
@hongkongkiwi

Description

@hongkongkiwi

Description and expected behavior

This fails

  @@deny('update', (
    !auth().isPlatformAdmin &&
    future().isPlatformAdmin
  ))

It fails with a very unhelpful error message:

✖ Generating PrismaClient enhancer
Prisma Enhancer: Unsupported expression type: InvocationExpr

Changing it to this works:

  @@deny('update', (
    auth().isPlatformAdmin == false &&
    future().isPlatformAdmin
  ))

If not a bug, I guess it would be good to flag this in the validation on the vscode plugin. But I guess it might be a bug.

Environment (please complete the following information):

  • ZenStack version: 2.10.2
  • Prisma version: 6.1.0
  • Database type: Postgresql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions