Using enums for permission #422
-
In permission model, epic-stack/app/utils/permissions.ts Lines 62 to 66 in 4fd50cd I was just wondering if we could benefit from enums for these fields with postgres etc. And how would the permission parsing be implemented that way. // File: schema.prisma
enum Action {
CREATE
READ
// ..
} PS: I was first thinking if there was a way to create epic-stack/app/utils/permissions.ts Line 64 in 4fd50cd Like: type Access = AllPossibleUniqueStringCombinations<'own' | 'team' | 'invited' | 'any'>
// would infer all possible string combinations But ended up thinking about why those weren't enums in the schema earlier |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
EpicStack uses SQLite, not PostgreSQL, and AFAIK SQLite doesn't support DB-level enums, so the only option is to have them in the code and not the schema. |
Beta Was this translation helpful? Give feedback.
EpicStack uses SQLite, not PostgreSQL, and AFAIK SQLite doesn't support DB-level enums, so the only option is to have them in the code and not the schema.