View data privileges¶
View a role’s current data-access privileges, their sources, and editability, to assess or adjust grants.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/data-privileges
Preparation before calling¶
First select a role. Prepare a personal access token that can access 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/data-privileges" -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 |
Target role ID. |
Successful response¶
Returns the role’s current data-privilege view, including direct and inherited privileges, MatrixOne privilege facts, and editability.
{"code":"OK","msg":"OK","data":{"target_role_id":"role-001","data_privilege_version":2,"matrixone_fact_version":"fact-v2","items":[],"request_id":"req-001","trace_id":"trace-001"}}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Role ID being viewed. |
|
integer |
Current data-privilege version; submit it as the expected version when updating. |
|
string |
MatrixOne privilege fact version. |
|
object array |
Role’s data-privilege items. |
|
string |
Request correlation ID. |
|
string |
Trace ID. |
Error response¶
{"code":"ErrParamInvalid","msg":"Invalid request parameters","data":null}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
null |
— |
Next steps¶
Confirm current data privileges¶
Before validating or applying data privileges, confirm the role’s current data access and prepare changes from the grant state read on this page.