View the role inheritance graph¶
View the complete role relationships reachable from a specified role to identify indirect inheritance and potential cycles.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/inheritance-graph
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-graph" \
-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 the role inheritance graph reachable from the target role and the current role graph version.
{
"code": "OK",
"msg": "OK",
"data": {
"root_role_id": "role-001",
"edges": [],
"role_graph_version": "graph-v1"
}
}
Field |
Type |
Description |
|---|---|---|
code |
string |
|
msg |
string |
|
data.root_role_id |
string |
Root role ID of the inheritance graph. |
data.edges |
object[] |
Reachable role inheritance edges. |
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 the inheritance graph¶
Before adding an inheritance relationship, view the complete role relationship graph and confirm that the new relationship does not create a cycle.