requireEntitlement
function requireEntitlement<C>( engine, feature, options): (req, res, next) => void;Defined in: src/adapters/express.ts:76
Express middleware guarding a route with an entitlement (ADR 0009): 402 /
403 JSON for denials, 401 without a customer; otherwise sets
req.entitlement (and res.locals.entitlement) and calls next().
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
C extends AnyCatalog |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
engine |
Entitlements<C> |
feature |
FeatureKey<C> |
options |
RequireEntitlementOptions<Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>> |
Returns
Section titled “Returns”(req, res, next) => void