Package-level declarations

User utils.

User

The UserManager component is designed to retrieve user information from the backend and store it in the database.

val coreContext: CoreContext
val userManager: UserManager = coreContext.userManager

lifecycleScope.launhc {
val user: User = userManager.fetch(1L)
val userWithRole = userManager.fetch(UserRole.MAIN)
}

User Roles

A user can have a role:

  • UserRole.MAIN - Session owner. The main user.

  • UserRole.PRIVATE - Virtual user - owner of a private section. Dependent on the user's MAIN.

  • UserRole.FAMILY - Virtual user - owner of a family section. Dependent on the user's MAIN.

  • No Role - Users who don't belong to any section. Often obtained from shared links.

Dependent users are deleted following their owners.

You can create a private user from UserManager.

val coreContext: CoreContext
val userManager: UserManager = coreContext.userManager

lifecycleScope.launhc {
val user: User = userManager.createPrivateUser(1L)
}

Types

Link copied to clipboard
data class User(val id: Long, val role: UserRole?, val schema: UserSchema)
Link copied to clipboard
interface UserManager
Link copied to clipboard