Tenant User

  • Has 1 User and 1 Tenant.
  • Defines a user membership to a tenant: OWNER, ADMIN or MEMBER.

Life Cycle

RouteCreateReadUpdateDelete
/register
/app/:tenant/settings/members

Properties

NameTitleTypeDescription
tenantId *TenantTenant
userId *UserUser
type *TypeTenantUserTypeOWNER, ADMIN or MEMBER
joined *JoinedTenantUserJoinedCREATOR, JOINED_BY_INVITATION, JOINED_BY_LINK (not supported yet), or JOINED_BY_PUBLIC_URL (not supported yet)
status *StatusTenantUserStatusPENDING_INVITATION, PENDING_ACCEPTANCE, ACTIVE, or INACTIVE
roles Tenant User RolesTenantUserRoles[]Not supported yet

Model

model TenantUser {
  id        String           @id @default(cuid())
  createdAt DateTime         @default(now())
  tenantId  String
  tenant    Tenant           @relation(fields: [tenantId], references: [id], onDelete: Cascade)
  userId    String
  user      User             @relation(fields: [userId], references: [id], onDelete: Cascade)
  type      Int
  joined    Int
  status    Int
  roles     TenantUserRole[]
}

cookies.titleSmall

cookies.descriptionSmall shared.learnMore.