Extending user schema
I'm not necessarily sure whether my design decision was right here but I am making an internal tool and I want to set it up so that each user has a list of allowed tabs they can view. I'm using the drizzle adapter and I felt the most natural type for the allowedTabs column would be an enum array. From what I understand, I don't think changes to schemas are automatically inferred in the functions/endpoints that work with the user or session objects and if you want this type inference you need to use the additionalFields property in the user/session objects of the auth config. However, I don't think the enum array type that I chose for this tabs column is supported.
I have a couple of questions
Thanks in advance!
I have a couple of questions
- This is mainly because I'm curious, but how big of a task would it be to figure out automatic type inference directly from schemas instead of the additional fields property? I feel like this would be a much better DX, but I'm also not experienced enough to understand the difficulties in setting up something like this and I'm thinking it's probably extremely dependent on choice of DB + adapter.
- It kind of seems like the organizations plug in could fit this user access I want to implement but I'm not sure whether it's overkill for my use case. Would greatly appreciate some insight into whether the organizations plugin seems like a right fit here.
Thanks in advance!