Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SqlUserUtil

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

  • SqlUserUtil

Index

Methods

createHashedUser

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

    Parameters

    • username: string
    • hash: string

    Returns PromiseLike<void>

  • Insert a user into a database.

    Parameters

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

    Returns SqlUserUtil

createRolePermission

  • createRolePermission(role: string, permission: string): PromiseLike<void>
  • createRolePermission(role: string, permission: string, resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): SqlUserUtil
  • Insert a role permission into a database.

    Parameters

    • role: string
    • permission: string

    Returns PromiseLike<void>

  • Insert a role permission into a database.

    Parameters

    • role: string
    • permission: string
    • resultHandler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns SqlUserUtil

createUser

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

    Parameters

    • username: string
    • password: string

    Returns PromiseLike<void>

  • Insert a user into a database.

    Parameters

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

    Returns SqlUserUtil

createUserRole

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

    Parameters

    • username: string
    • role: string

    Returns PromiseLike<void>

  • Insert a user role into a database.

    Parameters

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

    Returns SqlUserUtil

Static create

  • create(client: SqlClient): SqlUserUtil
  • create(client: SqlClient, insertUserSQL: string, insertUserRoleSQL: string, insertRolePermissionSQL: string): SqlUserUtil
  • Create an instance of the user helper.

    Parameters

    • client: SqlClient

    Returns SqlUserUtil

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

    Parameters

    • client: SqlClient
    • insertUserSQL: string
    • insertUserRoleSQL: string
    • insertRolePermissionSQL: string

    Returns SqlUserUtil

Generated using TypeDoc