You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cadt_rpc_api.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,10 @@ The CADT RPC API is exposed by default on port 31310. This document will give ex
27
27
28
28
If using a `CADT_API_KEY` append `--header 'x-api-key: <your-api-key-here>'` to your `curl` request.
29
29
30
+
## V2 Ownership Note
31
+
32
+
For the V2 API, update and delete requests can only stage mutations for records owned by the home organization. See the V2 API guide for details on `orgUid` ownership and child-record ownership resolution.
Copy file name to clipboardExpand all lines: docs/cadt_rpc_api_v2.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,12 @@ For tables with a direct `orgUid` column (project, unit, methodology, program, s
46
46
47
47
For child tables (location, estimation, rating, co_benefit, validation, verification, project_methodology, stakeholder_projects, unit_label, issuance, aef_t2-t5), this filters by the parent project's or unit's `orgUid` through an automatic JOIN.
48
48
49
+
### Ownership Restrictions
50
+
51
+
V2 `PUT` and `DELETE` requests can only stage mutations for records owned by the home organization. For tables with a direct `orgUid` column, the record's `orgUid` must match the home organization. For child and relationship tables, ownership is resolved through the referenced owner records, such as project, unit, program, methodology, label, stakeholder, and AEF parent records.
52
+
53
+
Requests that attempt to update, delete, or retarget a staged mutation to another organization's record are rejected with a `Restricted data` error.
54
+
49
55
### Pagination
50
56
51
57
All GET list endpoints require `page` and `limit` query parameters to prevent unbounded response sizes.
`Restricted data: cannot determine the owner of this ${table} record from ${unresolvedFields.join(', ')}. Only the home organization can modify this record.`,
260
+
);
261
+
}
262
+
263
+
if(ownerOrgUids.length===0){
264
+
if(!requireOwner)return;
265
+
266
+
thrownewError(
267
+
`Restricted data: cannot determine the owner of this ${table} record. Only the home organization can modify this record.`,
0 commit comments