View object permission view¶
View the current grants, grant sources, and editability for a specified role on a specified object.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/permissions/objects/{resource_type}/{resource_id}/permission-view
Preparation before calling¶
Select the object and role to view.
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/permissions/objects/$RESOURCE_TYPE/$RESOURCE_ID/permission-view" \
-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 resource type. |
|
string |
Yes |
Target resource ID. |
Successful response¶
On success, returns the object’s owner, direct grants, all-scope grants, and the capability sources included in this view. A false capability flag means that source is not included in this view; it does not mean that the corresponding grants are empty.
{"code":"OK","msg":"OK","data":{"workspace_id":"workspace-001","resource_type":"workflow","resource_id":"workflow-001","owner":{"role_id":"role-owner"},"capabilities":{"owner_included":true,"direct_specific_grants_included":true,"all_scope_grants_included":true},"direct_grants":[],"all_scope_grants":[],"request_id":"req-001","trace_id":"trace-001"}}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
string |
Workspace ID that contains the object. |
|
string |
Object resource type. |
|
string |
Object resource ID. |
|
object |
Object’s direct owner and ownership version. |
|
object |
Flags for data sources included in this permission view. |
|
object array |
Grants that directly apply to this object. |
|
object array |
All-scope grants that cover this object. |
|
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 object grant state¶
Before validating or applying object grants, confirm the current grant state for the object and role, and prepare changes based on the editability information returned by this page.