Updated on 2025-02-25 GMT+08:00

Listing Authorization Records

Function

This API is used to list authorization records.

URI

GET /v1/{project_id}/authorization/cooperate-authorization/rules

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

auth_level

No

String

Level of the authorization entity.

  • user: user.
  • group: user group.

filter_authed

No

Boolean

Whether to filter authorized entities. The default value is true, indicating that only authorized users and user groups are displayed.

Reserved field.

resource_id

Yes

String

Resource ID

resource_type

Yes

String

Explanation

Enumerated value of the resource type, which is used to specify the type of the authorized object.

For example, datasource indicates that the type of the authorized object is a data source.

Constraints

N/A

Value range

The enumerated values are:

  • datasource: data source.
  • dataset: dataset.
  • metric: indicator.
  • dashboard: dashboard.
  • screen: large screen.
  • embedAnalysis: embedded analytics.
  • portal: data portal.
  • subject: intelligent analysis assistant.

Default value

N/A

auth_name

No

String

Authorization entity name.

limit

No

Integer

Number of records displayed on each page.

offset

No

Integer

Offset.

sort_dir

No

String

asc: ascending order; desc: descending order.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Workspace-Id

Yes

String

Workspace ID. For how to obtain it, see Obtaining a Workspace ID.

X-Auth-Token

Yes

String

User token.

Obtain a user token by calling IAM's API. X-Subject-Token in the response header is the desired user token. For how to obtain a token, see Authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

page_data

Array of objects

Pagination list content. For parameter types, see CooperateAuthorizationRuleVO.

count

Integer

Total number of records.

Table 5 CooperateAuthorizationRuleVO

Parameter

Type

Description

auth_id

String

Authorization entity ID.

auth_level

String

Authorization entity level. The options include:

  • user: user.
  • group: user group.

auth_name

String

Authorization entity name.

authed

Boolean

Whether it is authorized.

authority

String

Permissions. The options include:

  • edit,export: edit and export permissions.
  • edit: edit permission.
  • export: export permission.
  • read: view permission.
  • use: use permission.
    NOTE:

    Permissions depend on each other.

    • Granting the edit permission will automatically grant the use and read permissions.
    • Granting the export permission will automatically grant the use and read permissions.
    • The export and edit operations do not depend on each other.

create_date

Long

Creation time.

create_user

String

Creator ID.

create_user_name

String

Creator name.

id

String

ID of an authorization record, which has no actual meaning.

is_owner

Boolean

Whether the user is the resource owner.

resource_id

String

Resource ID.

resource_type

String

Explanation

Enumerated value of the resource type, which is used to specify the type of the authorized object.

For example, datasource indicates that the type of the authorized object is a data source.

Constraints

N/A

Value range

The enumerated values are:

  • datasource: data source.
  • dataset: dataset.
  • metric: indicator.
  • dashboard: dashboard.
  • screen: large screen.
  • embedAnalysis: embedded analytics.
  • portal: data portal.
  • subject: intelligent analysis assistant.

Default value

N/A

sort

Integer

Sorting field, which has no actual meaning.

update_date

Long

Modification time.

update_user

String

Modifier ID.

update_user_name

String

Modifier name.

Example Request

List authorization records.

GET https://{endpoint}/v1/xxxx3ab4dac4055888643b331axxxx/authorization/cooperate-authorization/rules?resource_type=dataset&resource_id=f8e5406b-8662-4adb-a028-a55c76ae1166&auth_level=user&filer_authed=false&limit=20&offset=0&sort_dir=asc

Example Response

Status code: 200

OK.

{
  "page_data" : [ {
    "create_date" : 1690593374608,
    "create_user" : "xxxxxf45cea249a2aa648a20e46xxxxx",
    "create_user_name" : "xxxxxx",
    "update_date" : 1690593374608,
    "update_user" : "558def45cea249a2aa648a20e46xxxxx",
    "update_user_name" : "xxxxx",
    "id" : "73281a3b-a828-494a-bb0d-e88c688a5e81",
    "resource_type" : "dashboard",
    "resource_id" : "e3158b30-30bc-495a-b0d8-59e66e1xxxxx",
    "auth_level" : "user",
    "auth_id" : "xxxxf45cea249a2aa648a20e46xxxx",
    "auth_name" : "xxxxxx",
    "is_owner" : true,
    "authed" : true,
    "sort" : 4,
    "authority" : "edit"
  }, {
    "create_date" : 1690593374608,
    "create_user" : "xxxxxf45cea249a2aa648a20e46xxxxx",
    "create_user_name" : "xxxxxx",
    "update_date" : 1690593374608,
    "update_user" : "558def45cea249a2aa648a20e46xxxxx",
    "update_user_name" : "xxxxx",
    "id" : "73281a3b-a828-494a-bb0d-e88c688a5e81",
    "resource_type" : "dashboard",
    "resource_id" : "e3158b30-30bc-495a-b0d8-59e66e1xxxxx",
    "auth_level" : "user",
    "auth_id" : "xxxxf45cea249a2aa648a20e46xxxx",
    "auth_name" : "xxxxxx",
    "is_owner" : true,
    "authed" : true,
    "sort" : 4,
    "authority" : "edit,export"
  } ],
  "count" : 2147483647
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.