-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🏫 Organizations and Roles #961
Conversation
awtkns
commented
Jul 4, 2023
•
edited
Loading
edited
- Adds a superadmin (on the user column)
- Adds org table
- Adds table to associate users to orgs
- Users can make themselves admins on local now
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi 👋 Here's a preview environment 🚀 https://next-reworkd-agentgpt-961.env.ergomake.link Environment Summary 📑
Questions? Comments? Suggestions? Join Discord. Click here to disable Ergomake. |
next/prisma/schema.prisma
Outdated
user User @relation(fields: [user_id], references: [id], onDelete: NoAction) | ||
role Role @relation(fields: [role_id], references: [id], onDelete: NoAction) | ||
Organization Organization? @relation(fields: [organization_id], references: [id], onDelete: NoAction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we cascade delete onDelete
for user and organization?
next/prisma/schema.prisma
Outdated
id String @id @default(cuid()) | ||
name String @unique | ||
description String? | ||
UserRole UserRole[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_roles
?
Hi 👋 Here's a preview environment 🚀 https://next-reworkd-agentgpt-961.env.ergomake.link Environment Summary 📑
Here are your environment's logs. For questions or comments, join Discord. Click here to disable Ergomake. |
next/prisma/schema.prisma
Outdated
accounts Account[] | ||
sessions Session[] | ||
runs Run[] | ||
Agent Agent[] | ||
UserRole UserRole[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit in-consistent with casing, and plurals
Should we call this userRoles?
id String @id @default(cuid()) | ||
name String @unique | ||
|
||
created_by String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a username? email?
Thoughts on making this point to a owner user?
sqlite build failure |
export function useAuth( | ||
{ protectedRoute, isAllowed }: UseAuthOptions = { protectedRoute: false, isAllowed: () => true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We specify defaults but the fields are also nullable?
prisma/prisma#2219 good old primsa gotta love it |