TypeScript API / contentia/json-api / resolveAuthorization
Function: resolveAuthorization()
ts
function resolveAuthorization(decision):
| ContentiaError<ErrorCode, number>
| null;Normalise an AuthorizeDecision into either null (allowed) or the ContentiaError 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
| Parameter | Type |
|---|---|
decision | AuthorizeDecision |
Returns
| ContentiaError<ErrorCode, number> | null