Transfer an object’s owner role¶
PUT https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/iam/permissions/objects/{resource_type}/{resource_id}/owner
Before you call this API¶
Prepare the real resource type/ID, current per-object ownership_version, target active/ready role, and request identifier. The current formal permission boundary requires workspace role.manage_policy. The specification also describes an Owner exception not confirmed in this chain; see the end of this page.
Request¶
curl -X PUT "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/iam/permissions/objects/$RESOURCE_TYPE/$RESOURCE_ID/owner" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
--data-binary "$(jq -n --arg target "$TARGET_ROLE_ID" --arg request "$REQUEST_ID" --argjson version "$OWNERSHIP_VERSION" '{target_role_id:$target,expected_ownership_version:$version,request_id:$request}')"
Field |
Type |
Description |
|---|---|---|
target_role_id |
string, required |
Recipient role, distinct from the current owner. |
expected_ownership_version |
integer, required |
Current object integer version, greater than 0; not the deletion-set version. |
request_id |
string, required |
Stable identity for this transfer. Retain original content if the result is unknown. |
Result¶
{
"code": "OK",
"msg": "OK",
"data": {
"workspace_id": "workspace-example",
"resource_type": "connector",
"resource_id": "connector-example",
"previous_owner_role_id": "8",
"owner_role_id": "7",
"ownership_version": 4,
"request_id": "transfer-example",
"idempotent_replay": false
}
}
Ownership, version, idempotency receipt, and audit commit in one transaction. The current record must be active without repair_state; the recipient must be active/ready. Version/content conflicts return 409 ErrIAMObjectGrantConflict; invalid input422 ErrIAMObjectGrantInvalid; missing objects404 ErrIAMResourceNotFound. Same-request replay returns the original receipt; subsequent live authorization must still pass.
This transfers one object’s canonical Ownership. It deletes no role and does not copy the source role’s MatrixOne data privileges. When transferring several objects independently, earlier successes do not roll back automatically after later failures.
Permission contract requiring clarification¶
The specification’s object Owner exception, including inherited Owner, differs from the current boundary’s fixed workspace role.manage_policy requirement. Without a real owner-only call or complete PDP counterevidence, Owner status alone cannot be promised sufficient. Nor should implementation differences automatically become permanent rules. This page remains an internal clarification draft.