/workspace/getLayer

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

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:
NameTypeDescription
paramsObject
Properties
NameTypeAttributesDescription
params.localestring<optional>

Locale key.

params.layerstring<optional>

Layer key.

params.userObject<optional>

Requesting user.

user.rolesArray<optional>

User roles.

Returns:

JSON Layer.

Type: 
Promise.<(Object|Error)>