Get user role bindings¶
View the roles and default role of a specified user in the current workspace. Use this information when adjusting role assignments.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/users/{user_id}/role-bindings
Preparation before calling¶
First select the user.
Prepare a personal access token and target workspace ID with access to the target workspace.
Request parameters¶
curl -X GET "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/users/$USER_ID/role-bindings" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
|
string |
Yes |
ID of the user whose role bindings you want to view. |
Successful response¶
On success, returns the user’s direct role bindings, default role, and concurrency-control versions. When the user has no direct role bindings, the service can omit the role and default-role fields. Read the current versions again before updating bindings.
{
"code": "OK",
"msg": "OK",
"data": {
"user_id": "user-001",
"binding_version": "binding-v3",
"request_id": "req-001",
"trace_id": "trace-001"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Target user ID. |
|
object (array) |
Roles directly bound to the user, including their lifecycle, deployment, and optional states; returned when direct bindings exist. |
|
string |
Current default role ID; returned when a default role exists. |
|
integer |
Current default role version; returned when a default role exists. |
|
string |
Current role-binding version marker. |
|
string |
Request correlation ID. |
|
string |
Trace ID. |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
null |
— |
Next steps¶
Confirm current role bindings¶
Before updating a user’s role bindings, confirm the user’s current roles and default role, and use the binding state read on this page to prepare the change.