Skip to main content

User

Platform user with role-based access across Organizations and Tenants. Collection: users | DB: MongoDB Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/User.kt TypeScript: hbf-core-api/src/datamodel/user.ts

Fields

FieldTypeRequiredIndexedNotes
idStringyesPKMongoDB document ID
emailStringyesyes (non-unique)
passwordStringyesHashed
fullNameStringyes
imageStringnoAvatar URL
telephoneNumberStringno
countryStringno
languageStringnoPreferred language
isModeratorBooleanyesPlatform-wide moderator flag
emailVerifiedBooleanyesDefault: false
lastLoginDateno
accountLockedBooleanyesDefault: false
failedLoginAttemptsIntyesDefault: 0
lockedAtDatenoWhen account was locked
externalUsersSet<ExternalEntity>noMS Teams user mappings
organizationsList<Organization>yes@DBRef lazy
tenantRolesMap<String, Map<String, Set<TenantRole?>>>yesorg ID -> tenant ID -> roles
organizationRolesMap<String, Set<OrganizationRole?>>yesorg ID -> roles
effectiveRolesEffectiveRolesno@Transient, computed at runtime
isActiveBooleanno@Transient
createdAtDateyesyes@CreatedDate
updatedAtDateyes@LastModifiedDate

Nested Objects

EffectiveRoles

Computed at runtime, not persisted.

FieldTypeNotes
tenantRolesMap<String, Map<String, Set<TenantRole?>>>Effective tenant roles after grants
organizationRolesMap<String, Set<OrganizationRole?>>Effective org roles after grants

Enums

TenantRole

ValueDescription
HBF_TENANT_ADMINFull tenant access
HBF_TENANT_EDITOREdit bot content
HBF_TENANT_VIEWERView-only access
HBF_TENANT_LIVECHAT_ADMINManage live chat settings

OrganizationRole

See organization.md.

Relationships

  • Can belong to multiple Organizations (via @DBRef)
  • Has TenantRole entries per Organization per Tenant
  • Has OrganizationRole entries per Organization
  • Has ExternalEntity mappings for MS Teams identity

TypeScript Mapping

hbf-core (Kotlin)hbf-core-api (TypeScript)Notes
UserUserTS omits password, image, emailVerified, accountLocked, failedLoginAttempts, lockedAt, externalUsers, effectiveRoles, isActive, createdAt, updatedAt
TenantRoleTenantRoleTS adds HBF_TENANT_LIVE_AGENT, HBF_TENANT_LIVE_AGENT_ADMIN. Kotlin has HBF_TENANT_LIVECHAT_ADMIN
OrganizationRoleOrganizationRoleAligned
(not in Kotlin)TenantGrantsDeprecated alias in TS
(not in Kotlin)OrganizationGrantsDeprecated alias in TS
(not in Kotlin)TeamsMemberTS-only interface for MS Teams member data