/workspace/getLayer
The getLayer module exports the getLayer method which is required by the query and workspace modules.
- Source
Requires
Methods
(async, inner) getLayer(params) → {Promise.<(Object|Error)>}
The layer locale is requested from the getLocale module.
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 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)>