/workspace/getLayer
The getLayer module exports the getLayer method which is required by the query and workspace modules.
- Source
Requires
- module:/utils/roles
- module:/utils/merge
- module:/workspace/mergeTemplates
- module:/workspace/getLocale
- module:/workspace/getTemplate
Methods
(async, inner) getLayer(params) → {Promise.<(Object|Error)>}
The layer locale is requested from the getLocale module.
A layer template lookup will be attempted if a layer is not found in locale.layers.
The mergeTemplate module will be called to merge templates into the locale object and substitute SRC_* xyzEnvironment variables.
A role check is performed to check whether the requesting user has access to the locale.
Role objects in the layer are merged with their respective parent objects.
The layer.key and layer.name will be assigned if missing.
Parameters:
PropertiesName | Type | Description |
---|---|---|
params | Object |
Name | Type | Attributes | Description |
---|---|---|---|
params.locale | string | <optional> | Locale key. |
params.layer | string | <optional> | Layer key. |
params.user | Object | <optional> | Requesting user. |
user.roles | Array | <optional> | User roles. |
- Source
Returns:
JSON Layer.
- Type:
- Promise.<(Object|Error)>