MR check: api-gateway !7640: feat(authz): invited-company scope, finance write rules and tender invitees (batch 4) → autest
- MR api-gateway!7640, from
cherrypick-autest/hardening-gateway-batch4intoautest, by Rizqi, updated 2026-11-03, checked at commit0559214f. - Verdict: Affected. Of 50 certified dashboards: Broken 0, Affected 1, Needs review 0, Safe 49.
- Post the comment? Recommended: the developer should see this before merging.
- Changed: 0 migration(s), 0 model file(s), 32 code file(s) naming report data, 128 other file(s).
Drafted comment (not posted)
The comment a developer would see, between the two lines. Nothing is posted by the tool; whether comments are ever posted, and by whom, is not decided.
Report impact check: Affected. This MR changes data that 1 certified Superset dashboard shows. The reports keep working, but their numbers or labels can change.
Why:
tender.rules.ts: Tender route rules for invited subcontractors: for POST tenders/action and PUT tenders/tender-action/update/:UUID the gateway now drops lastStatusNegotiation (and eotDate) from an invitee's body. The invitee forms fill lastStatusNegotiation from the previous submission so project-services carries the negotiation status (e.g. 'ACCEPT') onto the new submission and resets the old ones; without it an invitee resubmission stores no status_negotiation, so Procurement Executive Summary (status_negotiation = 'ACCEPT') can lose that tender's value. Medium: depends on how often invitees resubmit after negotiation. (lines: tender.rules.ts line 1, tender.rules.ts line 2, tender.rules.ts line 3)project-access.guard.ts: Adds the tender-invitee path to the access guard, which deletes rule-listed body fields before the request reaches the controller. With tender.rules.ts this drops lastStatusNegotiation when an invited subcontractor creates or updates a tender submission. The invitee submission forms send the previous submission's negotiation status in that field and project-services copies it to the new submission while resetting the older ones, so an invitee's resubmission now ends with no status_negotiation and an 'ACCEPT' that Procurement Executive Summary counts can drop out. Medium: depends on how often invitees resubmit after a negotiation status is set. The other new parts (invitee query scoping on list routes) only read. (lines: project-access.guard.ts line 1, project-access.guard.ts line 2, project-access.guard.ts line 3)
| Dashboard | Verdict | Cause | Charts it touches |
|---|---|---|---|
| Procurement Executive Summary | Affected | 1, 2 | Procurement Executive Summary |
How the change reaches each dashboard
- Procurement Executive Summary (Affected, medium confidence): dataset "DATASET_Procurement Executive Summary" → 2 charts: Procurement Executive Summary, Procurement Executive Summary
Checked at 0559214f against the 50 published and certified Superset dashboards (map built 2026-11-16) by the Report Impact Checker AI Tool (read-only). Questions: Lucas (BI).
Details for Lucas
Reviewed: Safe
src/authz/rules/absent-on-branch.json: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/budget-schedule.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/collaboration.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/documents.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/finance.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/settings.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/site-people.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/site-quality.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/site-safety.rules.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/rules/unmapped.baseline.json: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/accounts-payable.guard.ts: Part of the gateway authorisation hardening: a guard or policy that allows or refuses a request after read-only lookups (find calls only). It does not change what permitted requests send to services, so no stored report data changes; the matched names are lookup fields.src/authz/collaboration-policy.ts: Part of the gateway authorisation hardening: a guard or policy that allows or refuses a request after read-only lookups (find calls only). It does not change what permitted requests send to services, so no stored report data changes; the matched names are lookup fields.src/authz/invitee-scope-policy.ts: Helpers that replace a request's organisation filter with the server's value on list routes (surveys, ITPs, defects) for invited companies. They only narrow what is read; nothing is written. The organization_uuid matches are filter fields.src/authz/record-resolvers.ts: Part of the gateway authorisation hardening: a guard or policy that allows or refuses a request after read-only lookups (find calls only). It does not change what permitted requests send to services, so no stored report data changes; the matched names are lookup fields.src/authz/route-inventory.ts: Part of the gateway authorisation hardening: a table of the permission each route needs (or a list of the routes it covers). It only decides whether a request is allowed; it sends nothing to services and changes no payload, so no stored data changes. The table, column and JSON names match route and permission names only.src/authz/tender-policy.ts: Part of the gateway authorisation hardening: a guard or policy that allows or refuses a request after read-only lookups (find calls only). It does not change what permitted requests send to services, so no stored report data changes; the matched names are lookup fields.src/authz/types.ts: Type definitions for the authorisation rules and access objects; no runtime behaviour and no stored data.src/controllers/site-management/incident.controller.ts: Adds the project access guard, refuses a confidential incident's detail to callers without the confidential permission, and puts the URL uuid after the body spread in category updates so the URL wins. Normal requests store the same values; is_confidential is only read.src/controllers/site-management/injury.controller.ts: Adds the project access guard and refuses a confidential injury's detail to callers without the confidential permission. Only reads and refuses requests; injuries and is_confidential are not written differently.src/controllers/site-management/observation.controller.ts: Adds the project access guard; the other lines are formatting only. Observation data written is unchanged; user_uuid is a lookup field.src/controllers/site-management/organisation.controller.ts: Adds the project access guard; the other line is formatting only. No change to what is written; organization_uuid is a lookup field.src/controllers/site-management/quality-observation.controller.ts: Adds the project access guard; the other lines are formatting only. Quality observation data written is unchanged; user_uuid is a lookup field.src/controllers/site-management/survey.controller.ts: Adds the access guard, makes the survey list filter use the project owner's organisation (a read), and puts the URL uuid after the body spread on update so the URL wins. Survey data written by normal requests is unchanged.src/controllers/site-management/swms.controller.ts: Adds the access guard, an organisation filter on the SWMS list (a read), and puts URL ids after body spreads so the URL wins. SWMS data written by normal requests is unchanged; swms_uuid is a lookup field.src/controllers/email.controller.ts: Adds access checks for invited tender companies on email detail and for editing email drafts. Only refuses requests; email data is not read by certified dashboards and organization_name is a lookup field.src/controllers/invoice.controller.ts: Adds finance access checks for invited companies and invoice approval rules, checks the invoice belongs to the project in the URL before a status change, returns status-update errors to the user, and puts URL ids after body spreads. These allow or refuse requests; the values written for permitted requests are unchanged.src/controllers/project-document.controller.ts: Adds access checks (public document links return a fixed field list and refuse confidential or folder documents; copying to another project needs membership there) and puts URL ids after body spreads so the URL wins. Project documents are not read by certified dashboards; revision_number is only in the public response field list.src/controllers/role-permission.controller.ts: Adds the access guard, refuses reading another organisation's roles unless the caller is a support user, and clears the access cache after role changes. Role data written is unchanged (reports only read role title and uuid); the organization_uuid and user_uuid matches are lookup fields.src/controllers/rwa.controller.ts: Moves body/query spreads before the server-set organization_uuid, user_id and uuid so a caller can no longer override them. Resource and allocation (RWA) data lives in task services, which no certified dashboard reads, and normal requests send the same values.src/controllers/tender.controller.ts: Adds tender policy checks, URL ids win over body values, the tender action update now passes only the fields project-services reads (lastStatusNegotiation, totalAmount and the rest kept), the email update only subject/body/status/attachments, and the expenditure approver is the caller. For project members the stored tender and tender_actions values reports read are unchanged; the invitee-only drop of lastStatusNegotiation is recorded on tender.rules.ts and project-access.guard.ts.
Reviewed: flagged
- Affected (medium):
src/authz/rules/tender.rules.ts: Tender route rules for invited subcontractors: for POST tenders/action and PUT tenders/tender-action/update/:UUID the gateway now drops lastStatusNegotiation (and eotDate) from an invitee's body. The invitee forms fill lastStatusNegotiation from the previous submission so project-services carries the negotiation status (e.g. 'ACCEPT') onto the new submission and resets the old ones; without it an invitee resubmission stores no status_negotiation, so Procurement Executive Summary (status_negotiation = 'ACCEPT') can lose that tender's value. Medium: depends on how often invitees resubmit after negotiation. - Affected (medium):
src/authz/project-access.guard.ts: Adds the tender-invitee path to the access guard, which deletes rule-listed body fields before the request reaches the controller. With tender.rules.ts this drops lastStatusNegotiation when an invited subcontractor creates or updates a tender submission. The invitee submission forms send the previous submission's negotiation status in that field and project-services copies it to the new submission while resetting the older ones, so an invitee's resubmission now ends with no status_negotiation and an 'ACCEPT' that Procurement Executive Summary counts can drop out. Medium: depends on how often invitees resubmit after a negotiation status is set. The other new parts (invitee query scoping on list routes) only read.