-
-
Notifications
You must be signed in to change notification settings - Fork 126
Description
i tried every permutation combo to get auth().isAdmin to be detected and its failing.
@@Allow('update', auth().userId == id || auth().isAdmin == true)
the isAdmin throws
Could not resolve reference to MemberAccessTarget named 'isAdmin'.zmodel(linking-error)
this is what I have at the top of my schema file:
type Auth {
userId String @id
organizationId String?
organizationRole String?
isAdmin Boolean // Platform admin role
isBanned Boolean // If user is banned
@@auth
}
model User {
id String @id @default(cuid()) // Use cuid from application
username String @unique @db.VarChar(255) // Kept from application for uniqueness
name String? // Added from better-auth for display name
email String? @unique @db.VarChar(255)
emailVerified DateTime? // Using DateTime standard
image String? @db.Text // Maps to better-auth image, keeps @db.Text
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
role String? // Platform-level role (e.g., 'admin', 'moderator'), distinct from Member.role
isAdmin Boolean @default(false) // Kept for platform admin checks
}
I tried it without type Auth
I tried it with @@auth in model User
I tried it without model User and just type Auth
Basically every single permutation to get this working and its failing. I have the zenstack extension installed.
I was looking forward to using zenstack but I cannot continue.