Interface: ResourcefulQueryScopeCallback()
Function type for applying query-level scoping to database queries.
These callbacks are applied to queries during CRUD operations to enforce data access boundaries based on request context. They modify the query in-place by adding WHERE clauses, JOINs, or other constraints.
ts
ResourcefulQueryScopeCallback(
ctx: HttpContext,
app: ApplicationService,
query: DatabaseQueryBuilderContract,
model: ResourcefulModel): PromiseAble<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | HttpContext | HTTP context containing request information and authentication |
app | ApplicationService | Application service instance for accessing app-level services |
query | DatabaseQueryBuilderContract | Database query builder to modify with scoping constraints |
model | ResourcefulModel | The resourceful model class the query is being built for |
Returns
PromiseAble<void>
Promise that resolves when the query has been modified