Skip to content

ambiten


ambiten / core/src / authorize

Function: authorize() ​

authorize(roles): (req, res, next) => Response<any, Record<string, any>> | { _id: string; role: string; tenantId: string; } | undefined

Defined in: packages/core/src/middleware/authorization/auth.ts:17

Middleware to authorize access to routes based on user roles. This middleware checks if the request contains a valid JWT token,

Parameters ​

roles ​

string[]

An array of roles that are allowed to access the route.

Returns ​

(req, res, next) => Response<any, Record<string, any>> | { _id: string; role: string; tenantId: string; } | undefined

Context-aware execution infrastructure for multi-tenant systems.