Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hongkongkiwi opened this issue Jan 6, 2025 · 0 comments
Open

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

hongkongkiwi opened this issue Jan 6, 2025 · 0 comments

Comments

@hongkongkiwi
Copy link

hongkongkiwi commented Jan 6, 2025

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
@hongkongkiwi hongkongkiwi changed the title Rules with !auth().someBool causes failure [Bug] Rules with !auth().someBool causes failure Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant