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

workspace_id

string

Yes

Target workspace ID.

role_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

code

string

OK on success.

msg

string

OK on success.

data.target_role_id

string

Role ID being viewed.

data.data_privilege_version

integer

Current data-privilege version; submit it as the expected version when updating.

data.matrixone_fact_version

string

MatrixOne privilege fact version.

data.items

object array

Role’s data-privilege items.

data.request_id

string

Request correlation ID.

data.trace_id

string

Trace ID.

Error response

{"code":"ErrParamInvalid","msg":"Invalid request parameters","data":null}

Field

Type

Description

code

string

Error code.

msg

string

Error message.

data

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.

Last updated on