Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MongoUserUtil

Utility to create users/roles/permissions. This is a helper class and not intended to be a full user management utility. While the standard authentication and authorization interfaces will require usually read only access to the database, in order to use this API a full read/write access must be granted.

Hierarchy

  • MongoUserUtil

Index

Methods

createHashedUser

  • createHashedUser(username: string, hash: string): PromiseLike<string>
  • createHashedUser(username: string, hash: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoUserUtil
  • Insert a user into a database.

    Parameters

    • username: string
    • hash: string

    Returns PromiseLike<string>

  • Insert a user into a database.

    Parameters

    • username: string
    • hash: string
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns MongoUserUtil

createUser

  • createUser(username: string, password: string): PromiseLike<string>
  • createUser(username: string, password: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoUserUtil
  • Insert a user into a database.

    Parameters

    • username: string
    • password: string

    Returns PromiseLike<string>

  • Insert a user into a database.

    Parameters

    • username: string
    • password: string
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns MongoUserUtil

createUserRolesAndPermissions

  • createUserRolesAndPermissions(username: string, roles: string, permissions: string): PromiseLike<string>
  • createUserRolesAndPermissions(username: string, roles: string, permissions: string, resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MongoUserUtil
  • Insert a user role into a database.

    Parameters

    • username: string
    • roles: string
    • permissions: string

    Returns PromiseLike<string>

  • Insert a user role into a database.

    Parameters

    • username: string
    • roles: string
    • permissions: string
    • resultHandler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>

    Returns MongoUserUtil

Static create

  • Create an instance of the user helper.

    Parameters

    • client: MongoClient

    Returns MongoUserUtil

  • Create an instance of the user helper with custom queries.

    Parameters

    Returns MongoUserUtil

Generated using TypeDoc