Module: utils

Members

(inner, constant) defaultUserPermissions

Default permissions for users
Source:

Methods

(async, inner) authorize(permissions, req, res, sendResponse) → {Promise:.<boolean:>}

Checks if the user has the required permissions to access the endpoint
Parameters:
Name Type Default Description
permissions Array:.<string:>
req any
res any
sendResponse boolean true If true, send a response if the user is not authorized
Source:
Returns:
Type
Promise:.<boolean:>

(inner) createTerms(text) → {Array:.<string:>}

Create terms used in the database from text
Parameters:
Name Type Description
text string
Source:
Returns:
Type
Array:.<string:>

(inner) generateTempImagePath() → {string}

Generate a temporary image path
Source:
Returns:
path
Type
string

(inner) split(text, separators) → {Array:.<string:>}

Split a text using more than one separator
Parameters:
Name Type Description
text string
separators Array:.<string:>
Source:
Returns:
Type
Array:.<string:>