This module is meant handling dashboard user accounts
- Description:
This module is meant handling dashboard user accounts
- Source:
Methods
(static) checkNoteEditPermission(params) → {boolean}
- Description:
Check update or delete note permission.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) createUser(params) → {boolean}
- Description:
Create new dashboard user and output result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if user created
- Type
- boolean
(static) deleteNote(params) → {boolean}
- Description:
Delete Note
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) deleteUser(params) → {boolean}
- Description:
Deletes dashboard user and output result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if user was deleted
- Type
- boolean
(static) deleteUserNotes(params) → {boolean}
- Description:
Delete deleted user note
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) fetchNotes(params) → {boolean}
- Description:
fetch Notes
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) fetchUserAppIds(params) → {array}
- Description:
fetch apps id for those user can access;
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
app id array
- Type
- array
(static) getAllUsers(params) → {boolean}
- Description:
Get list of all users, for global admins only, and outputs to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if fetched data from db
- Type
- boolean
(static) getCurrentUser(params) → {boolean}
- Description:
Get data about current user and output to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) getUserById(params) → {boolean}
- Description:
Get data about specific user by user id, and outputs to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if fetched data from db
- Type
- boolean
(static) resetTimeBan(params) → {boolean}
- Description:
Reset timeban for user and output result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if timeban reseted
- Type
- boolean
(static) saveNote(params) → {boolean}
- Description:
Create or update note
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true
- Type
- boolean
(static) updateUser(params) → {boolean}
- Description:
Updates dashboard user's data and output result to browser
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
params | params object |
Returns:
true if user was updated
- Type
- boolean
(inner) argon2Hash(str) → {promise}
- Description:
Create argon2 hash string
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | string to hash |
Returns:
hash promise
- Type
- promise
(inner) deleteUserPresets(memberId)
- Description:
Delete user's date presets
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
memberId |
string | | User id |
(async, inner) depCheck(params)
- Description:
Checks the permission dependencies of features for each app based on the enabled features, enabling the required permission dependencies if necessary.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
params |
object | params object. |
(inner) isArgon2Hash(hashedStr) → {boolean}
- Description:
Is hashed string argon2?
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
hashedStr |
string | | argon2 hashed string |
Returns:
return true if string hashed by argon2
- Type
- boolean
(inner) killAllSessionForUser(userId)
- Description:
Removes all active sessions for user
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | id of the user for which to remove sessions |
(inner) sha1Hash(str, addSalt) → {string}
- Description:
Create sha1 hash string
- Source:
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}
- Description:
Create sha512 hash string
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string | string to hash |
addSalt |
boolean | should salt be added |
Returns:
hashed string
- Type
- string
(inner) updateUserPasswordToArgon2(id, password)
- Description:
Update user password to new sha512 hash
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | id of the user document |
password |
string | password to hash |
(inner) verifyArgon2Hash(hashedStr, str) → {promise}
- Description:
Verify argon2 hash string
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
hashedStr |
string | argon2 hashed string |
str |
string | string for verify |
Returns:
verify promise
- Type
- promise
(inner) verifyMemberArgon2Hash(username, password, callback)
- Description:
Verify member for Argon2 Hash
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
username |
string | | User name |
password |
password | | Password string |
callback |
function | | Callback function |