Scope server with workspace (#157)
* Rename User to AuthUser to avoid naming conflict with user business entity * Prevent query by workspace in graphql * Make full user and workspace object available in graphql resolvers * Add Seed to create companies and people accross two workspace * Check workspace on all entities findMany, find, create, update)
This commit is contained in:
@ -35,6 +35,7 @@ model User {
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
/// @TypeGraphQL.omit(input: true)
|
||||
model Workspace {
|
||||
id String @id
|
||||
createdAt DateTime @default(now())
|
||||
@ -57,7 +58,9 @@ model WorkspaceMember {
|
||||
deletedAt DateTime?
|
||||
userId String @unique
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
/// @TypeGraphQL.omit(input: true)
|
||||
workspaceId String
|
||||
/// @TypeGraphQL.omit(input: true)
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id])
|
||||
|
||||
@@map("workspace_members")
|
||||
@ -105,6 +108,7 @@ model Person {
|
||||
@@map("people")
|
||||
}
|
||||
|
||||
/// @TypeGraphQL.omit(input: true)
|
||||
model RefreshToken {
|
||||
id String @id
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Reference in New Issue
Block a user