api/parts/mgmt/users

This module is meant handling dashboard user accounts

Source:

Methods

(static) checkNoteEditPermission(params) → {boolean}

Source:

Check update or delete note permission.

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) createUser(params) → {boolean}

Source:

Create new dashboard user and output result to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if user created

Type
boolean

(static) deleteNote(params) → {boolean}

Source:

Delete Note

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) deleteUser(params) → {boolean}

Source:

Deletes dashboard user and output result to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if user was deleted

Type
boolean

(static) deleteUserNotes(params) → {boolean}

Source:

Delete deleted user note

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) fetchNotes(params) → {boolean}

Source:

fetch Notes

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) fetchUserAppIds(params) → {array}

Source:

fetch apps id for those user can access;

Parameters:
Name Type Description
params params

params object

Returns:

app id array

Type
array

(static) getAllUsers(params) → {boolean}

Source:

Get list of all users, for global admins only, and outputs to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if fetched data from db

Type
boolean

(static) getCurrentUser(params) → {boolean}

Source:

Get data about current user and output to browser

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) getUserById(params) → {boolean}

Source:

Get data about specific user by user id, and outputs to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if fetched data from db

Type
boolean

(static) resetTimeBan(params) → {boolean}

Source:

Reset timeban for user and output result to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if timeban reseted

Type
boolean

(static) saveNote(params) → {boolean}

Source:

Create or update note

Parameters:
Name Type Description
params params

params object

Returns:

true

Type
boolean

(static) updateUser(params) → {boolean}

Source:

Updates dashboard user's data and output result to browser

Parameters:
Name Type Description
params params

params object

Returns:

true if user was updated

Type
boolean

(inner) argon2Hash(str) → {promise}

Source:

Create argon2 hash string

Parameters:
Name Type Description
str string

string to hash

Returns:

hash promise

Type
promise

(inner) isArgon2Hash(hashedStr) → {boolean}

Source:

Is hashed string argon2?

Parameters:
Name Type Description
hashedStr string

| argon2 hashed string

Returns:

return true if string hashed by argon2

Type
boolean

(inner) killAllSessionForUser(userId)

Source:

Removes all active sessions for user

Parameters:
Name Type Description
userId string

id of the user for which to remove sessions

(inner) sha1Hash(str, addSalt) → {string}

Source:

Create sha1 hash string

Parameters:
Name Type Description
str string

string to hash

addSalt boolean

should salt be added

Returns:

hashed string

Type
string

(inner) sha512Hash(str, addSalt) → {string}

Source:

Create sha512 hash string

Parameters:
Name Type Description
str string

string to hash

addSalt boolean

should salt be added

Returns:

hashed string

Type
string

(inner) updateUserPasswordToArgon2(id, password)

Source:

Update user password to new sha512 hash

Parameters:
Name Type Description
id string

id of the user document

password string

password to hash

(inner) verifyArgon2Hash(hashedStr, str) → {promise}

Source:

Verify argon2 hash string

Parameters:
Name Type Description
hashedStr string

argon2 hashed string

str string

string for verify

Returns:

verify promise

Type
promise

(inner) verifyMemberArgon2Hash(username, password, callback)

Source:

Verify member for Argon2 Hash

Parameters:
Name Type Description
username string

| User name

password password

| Password string

callback function

| Callback function