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

auth() with import causes linking-error #1257

Closed
platon-ivanov opened this issue Apr 14, 2024 · 2 comments
Closed

auth() with import causes linking-error #1257

platon-ivanov opened this issue Apr 14, 2024 · 2 comments
Milestone

Comments

@platon-ivanov
Copy link

Description and expected behavior
auth() function fields aren't resolved when User model is imported.

Screenshots
image

Environment (please complete the following information):

  • ZenStack version: next
  • Prisma version: 5.5.2
  • Database type: Postgresql

Additional context

user.zmodel:

import "./base"
import "./image"

model User extends Base {
    email String @unique

    @@auth
}

image.zmodel:

import "./user"
import "./base"

model Image extends Base {
    width Int @default(0)
    height Int @default(0)

    @@allow('read', true)
    @@allow('all', auth().role == Admin)
}
@ymc9 ymc9 added this to the v2.0.0 milestone Apr 15, 2024
@ymc9
Copy link
Member

ymc9 commented Apr 15, 2024

Thanks for reporting it @platon-ivanov ! Will make a fix and include in the upcoming new beta.

@ymc9
Copy link
Member

ymc9 commented Apr 15, 2024

Fixed in 2.0.0-beta.13

@ymc9 ymc9 closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants