Help Center/ KooDrive/ API Reference/ API/ Permissions Templates/ Listing Permissions Templates by Condition
Updated on 2025-03-14 GMT+08:00

Listing Permissions Templates by Condition

Function

List permissions templates by condition.

URI

GET /koodrive/ose/v1/permission/template/list

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

limit

Yes

Integer

Maximum number of records to be returned. Value range: 1 to 100.

offset

Yes

Integer

Offset. Minimum value: 0.

id

No

Long

Unique ID of a permissions template.

templateType

No

Integer

Permissions template type. 0: preset; 1: custom.

status

No

Integer

Permissions template status. 0: disabled; 1: enabled.

orderByTime

No

Integer

Sorted by createTime. The value can only be 0 (descending order) or 1 (ascending order).

preBefore

No

Boolean

Whether preset templates are placed on the top or at the bottom.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

The format is Bearer {app_access_token}. The application-level token needs to be passed for calling by an application server. The token is obtained by calling an API using clientid and clientSecret obtained during application creation.

X-User-Id

Yes

String

User ID, which is used for app authentication.

X-Date

Yes

String

Date, which is used for app authentication.

Host

No

String

Address, which is used for app authentication.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

code

Integer

Response code.

msg

String

Response information.

data

Array of PermissionTemplate objects

Permissions template information.

total

Integer

Total number of permissions templates (including preset templates) in the current enterprise.

Table 4 PermissionTemplate

Parameter

Type

Description

id

String

Unique ID of a permissions template.

name

String

Permissions template name.

description

String

Permissions template description.

templateType

Integer

Permissions template type. 0: preset; 1: custom.

status

Integer

Permissions template status. 0: disabled; 1: enabled.

company

String

Enterprise to which the permissions template belongs. The value can be an organization ID or an application ID.

createTime

String

Time when the permissions template is created.

updateTime

String

Time when the permissions template is updated.

capabilities

Capabilities object

Permissions value.

Table 5 Capabilities

Parameter

Type

Description

addChildNodePermission

Boolean

Permission to create a file or folder. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

copyPermission

Boolean

Copy permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

deletePermission

Boolean

Delete permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

downloadPermission

Boolean

Download permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

editPermission

Boolean

Edit permissions. true: granted; false: not granted (editing is not supported.)

listChildNodePermission

Boolean

Permission to view the list. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

removeChildNodePermission

Boolean

Move permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

renameFilePermission

Boolean

Rename permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

shareFilePermission

Boolean

Share permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

uploadPermission

Boolean

Upload permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

viewPermission

Boolean

Preview permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

Example Requests

/koodrive/cloudfile/v1/permission/template/list?offset=0&limit=20&orderByTime=0&templateType=1

Authorization:Bearer+10f88**********4791e9f

Example Responses

Status code: 200

Response body.

{
  "total" : 1,
  "data" : [ {
    "id" : "***",
    "name" : "*****",
    "description" : "",
    "templateType" : 1,
    "status" : 1,
    "company" : "*****",
    "createTime" : "2025-01-03T08:15:14.339Z",
    "updateTime" : "2025-01-03T08:54:47.814Z",
    "capabilities" : {
      "addChildNodePermission" : false,
      "copyPermission" : false,
      "deletePermission" : false,
      "downloadPermission" : false,
      "editPermission" : false,
      "listChildNodePermission" : true,
      "removeChildNodePermission" : false,
      "renameFilePermission" : false,
      "shareFilePermission" : false,
      "uploadPermission" : false,
      "viewPermission" : false
    }
  } ],
  "code" : 0,
  "msg" : "Successful."
}

Status Codes

Status Code

Description

200

Response body.