Skip to content

TypeScript API / laikacms/json-api / resolveAuthorization

Function: resolveAuthorization() ​

ts
function resolveAuthorization(decision): 
  | LaikaError<ErrorCode, number>
  | null;

Normalise an AuthorizeDecision into either null (allowed) or the LaikaError that should be returned to the client. A bare false becomes a generic ForbiddenError; a returned error is passed through unchanged so its own code/status drive the HTTP response.

Parameters ​

ParameterType
decisionAuthorizeDecision

Returns ​

| LaikaError<ErrorCode, number> | null

Released under the MIT License.