feat(acls): added backend acls

This commit is contained in:
DecDuck
2025-02-04 13:15:34 +11:00
parent 256fbd6afa
commit 090d2e6586
70 changed files with 397 additions and 474 deletions

View File

@ -21,3 +21,18 @@ model Invitation {
email String?
expires DateTime
}
enum APITokenMode {
User
System
}
model APIToken {
token String @id @default(uuid())
mode APITokenMode
userId String?
user User? @relation(fields: [userId], references: [id])
acls String[]
}

View File

@ -14,7 +14,7 @@ model CollectionEntry {
collection Collection @relation(fields: [collectionId], references: [id], onDelete: Cascade)
gameId String
game Game @relation(fields: [gameId], references: [id])
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
@@id([collectionId, gameId])
}

View File

@ -12,6 +12,8 @@ model User {
notifications Notification[]
collections Collection[]
news News[]
tokens APIToken[]
}
model Notification {