Users

Mixes In:

# new uba_user_ns ()

Members

# attrs : ubaUserAttrs static

Attributes defined in metadata. Property does not exist in real life and added for IDE

# entity : UBEntity instance

Reference to entity metadata

Methods

# addNew (ctxubMethodParams) instance

Create record with filled default values and return it to caller. Newly created record is not inserted to database. For inserting record to the database insert method should be called

Arguments:

# delete (ctxubMethodParams) instance

Delete record by ID

Arguments:

# insert (ctxubMethodParams) instance

New record insertion

Arguments:

# select (ctxubMethodParams) instance

ORM query for read records

Arguments:

# update (ctxubMethodParams) instance

Update existed record

Arguments:
  • ctx: ubMethodParams
    • mParamsobject

      Update method parameters

    • fieldListarray.<string>

      Optional attributes names. Values of this attributes will be returned in result. Additional DB query is required to return values, so if caller do not need it better to not pass a fieldList to update

# changeLanguage (ctxtubMethodParams) instance

Change (or set) current user language. After call to this method UI must log out user and reload itself.

Arguments:

# changeOtherUserPassword (ctxubMethodParams) instance

Change (or set) user password for any user. Call of this method should be restricted to a small number of roles/groups. By default, can be called by supervisor role

Arguments:

# changePassword (userIDnumber, userNamestring, passwordstring, needChangePasswordoptboolean, oldPwdHashoptstring) instance

Change user password

Arguments:
  • userID: number
  • userName: string

    Either userName or userID must be specified

  • password: string
  • needChangePassword = false: boolean

    If true the password will by expired

  • oldPwdHash: string

    Optional for optimisation

# getUserData (fake*, reqTHTTPRequest, respTHTTPResponse) instance

Rest endpoint what returns a userData - information about logged-in user. For clients what uses an UBConnection userData is already available and can be obtained using connection.userData() function. This endpoint is mostly for third-party integration.

Arguments:
  
      GET /rest/uba_user/getUserData
  

# setUDataKey (ctxtubMethodParams) instance

Set key value inside uba_user.uData and store new JSON do DB. All other uData JSON keys will remain unchanged.

WARNING - overall length of uba_user.uData is 2000 characters, so only short values should be stored there

Arguments: