I am exploring making a T3 app (next/trpc/prisma) there the ~entire experience is behind login (Clerk for now).
All content in the DB is private, meaning that only the User's that are part of the same Group should have access to CRUD it.
Are there established patterns for making sure my trpc routers ensure the current user (via ctx, i guess?) can access the DB records being requested? I know there are protectProcedures, but I believe that just means the user has to be logged in - versus being logged in and having access to the records.
I had thought about exploring having discrete databases for each UserGroup - so a user only has access to a single DB, and that DB only contains its data - but that sounds difficult to auto-provision on new UseGroup signup (ill probably be using some cloud Postgres solution in the end).