Users
# 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 (ctx: ubMethodParams) 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:
ctx
: ubMethodParamsmParams
: objectOptional values for attributes of new record
# delete (ctx: ubMethodParams) instance
Delete record by ID
Arguments:
ctx
: ubMethodParamsmParams
: objectDelete method parameters
# insert (ctx: ubMethodParams) instance
New record insertion
Arguments:
ctx
: ubMethodParamsmParams
: objectInsert method parameters
# select (ctx: ubMethodParams) instance
ORM query for read records
Arguments:
ctx
: ubMethodParamsmParams
: UBQLORM query in UBQL format
# update (ctx: ubMethodParams) instance
Update existed record
Arguments:
ctx
: ubMethodParams
# changeLanguage (ctxt: ubMethodParams) instance
Change (or set) current user language. After call to this method UI must log out user and reload itself.
Arguments:
ctxt
: ubMethodParams
# changeOtherUserPassword (ctx: ubMethodParams) 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:
ctx
: ubMethodParams
# changePassword (userID: number, userName: string, password: string, needChangePasswordopt: boolean, oldPwdHashopt: string, skipOnMatchopt: boolean, newerExpireopt: boolean) → boolean instance
Change user password
Return:
is password changed
Arguments:
userID
: numberuserName
: stringEither userName or userID must be specified
password
: stringneedChangePassword
= false: booleanIf true the password will be expired
oldPwdHash
: stringOptional for optimisation
skipOnMatch
= false: booleanOptional - do not update password in case password hash is not changed
newerExpire
= false: booleanOptional - set lastChangeDate to infinity, so password newer expire
# getUserData (fake: *, req: THTTPRequest, resp: THTTPResponse) 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:
fake
: *req
: THTTPRequestresp
: THTTPResponse
GET /rest/uba_user/getUserData
# setUDataKey (ctxt: ubMethodParams) 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:
ctxt
: ubMethodParams