/workspace/getLocale

The getLocale module exports the getLocale method which is required by the getLayer and workspace modules.

Requires

Methods

(async, inner) getLocale(params) → {Promise.<(Object|Error)>}

The getLocale method requests the workspace from cache and checks whether the requested locale is a property of the workspace.locales{}.

The workspace.locale is assigned as locale if params.locale is undefined.

The mergeTemplate module will be called to merge templates into the locale object and substitute SRC_* environment variables.

A role check is performed to check whether the requesting user has access to the locale.

Role objects in the locale and nested layers are merged with their respective parent objects.

Parameters:
NameTypeDescription
paramsObject
Properties
NameTypeAttributesDescription
params.localestring<optional>

Locale key.

params.userObject<optional>

Requesting user.

user.rolesArray<optional>

User roles.

Returns:

JSON Locale.

Type: 
Promise.<(Object|Error)>