View role inheritance relationships¶
View a specified role’s direct parent roles and current inheritance relationships before adding or removing inheritance.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/inheritance
Preparation before calling¶
First select the role. Prepare a personal access token with access to the target workspace and the target workspace ID.
Request parameters¶
curl -X GET "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/inheritance" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
workspace_id |
string |
Yes |
Target workspace ID. |
role_id |
string |
Yes |
Target role ID. |
Successful response¶
On success, returns direct inheritance edges for the role and the current role graph version. Submit this version when you update inheritance.
{
"code": "OK",
"msg": "OK",
"data": {
"edges": [{"child_role_id": "role-001", "parent_role_id": "role-parent", "with_grant_option": false, "grant_id": "grant-001"}],
"role_graph_version": "graph-v1"
}
}
Field |
Type |
Description |
|---|---|---|
code |
string |
|
msg |
string |
|
data.edges |
object[] |
Direct inheritance edges for the role. |
data.edges[].child_role_id |
string |
Child role ID. |
data.edges[].parent_role_id |
string |
Parent role ID. |
data.edges[].with_grant_option |
boolean |
Whether the inheritance grants grant option. |
data.edges[].grant_id |
string |
Inheritance grant ID. |
data.role_graph_version |
string |
Current role graph version. |
Error response¶
{"code": "ErrParamInvalid", "msg": "请求参数无效", "data": null}
Field |
Type |
Description |
|---|---|---|
code |
string |
Error code. |
msg |
string |
Error message. |
data |
null |
— |
Next steps¶
Confirm inheritance relationships¶
Before adding or removing role inheritance, confirm the current direct parent-role relationships and use the current relationship shown on this page to prepare the change.