From 40a7d6e4fba6634fc9ba4a03ddca8b8aec380189 Mon Sep 17 00:00:00 2001 From: Peter Wilfahrt Date: Wed, 18 Nov 2026 19:54:14 +0000 Subject: [PATCH] Enforce list access check on get_min_max_for_columns endpoint --- adminforth/modules/restApi.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/adminforth/modules/restApi.ts b/adminforth/modules/restApi.ts index cd8a0da60..95e82e0e5 100644 --- a/adminforth/modules/restApi.ts +++ b/adminforth/modules/restApi.ts @@ -2046,7 +2046,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI { }, request_schema: getMinMaxForColumnsRequestSchema, response_schema: getMinMaxForColumnsResponseSchema, - handler: async ({ body }) => { + handler: async ({ body, adminUser }) => { const { resourceId } = body; if (!this.adminforth.statuses.dbDiscover) { return { error: 'Database discovery not started' }; @@ -2058,6 +2058,17 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI { if (!resource) { return { error: `Resource '${resourceId}' not found` }; } + const { allowedActions } = await interpretResource( + adminUser, + resource, + { requestBody: body, pk: undefined }, + ActionCheckSource.ListRequest, + this.adminforth + ); + const { allowed, error } = checkAccess(AllowedActionsEnum.list, allowedActions); + if (!allowed) { + return { error }; + } const item = await this.adminforth.connectors[resource.dataSource].getMinMaxForColumns({ resource, columns: resource.columns.filter((col) => [