Help Center/ KooDrive/ API Reference/ API/ Permissions Templates/ Adding or Modifying the Association Relationship of the Initial Member Permissions
Updated on 2025-03-14 GMT+08:00

Adding or Modifying the Association Relationship of the Initial Member Permissions

Function

Add or modify the association relationship with the initial member permissions. If an association relationship does not exist in the table, it will be added. If it exists in the table, it will be modified.

URI

POST /koodrive/ose/v1/permission/member/initial

Request Parameters

Table 1 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.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

spaceId

Yes

Long

Group or department ID.

templateId

Yes

String

Permissions template ID. For an anonymous template, the value is -1.

capabilities

No

Capabilities object

This field is required for an anonymous template, but it is optional for a named template.

Table 3 Capabilities

Parameter

Mandatory

Type

Description

addChildNodePermission

Yes

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

Yes

Boolean

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

deletePermission

Yes

Boolean

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

downloadPermission

Yes

Boolean

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

editPermission

Yes

Boolean

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

listChildNodePermission

Yes

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

Yes

Boolean

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

renameFilePermission

Yes

Boolean

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

shareFilePermission

Yes

Boolean

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

uploadPermission

Yes

Boolean

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

viewPermission

Yes

Boolean

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

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

code

String

Error code.

msg

String

Error message.

Example Requests

/koodrive/ose/v1/permission/member/initial

{
  "spaceId" : "******",
  "templateId" : "*****",
  "capabilities" : {
    "addChildNodePermission" : false,
    "copyPermission" : false,
    "deletePermission" : false,
    "downloadPermission" : true,
    "editPermission" : false,
    "listChildNodePermission" : true,
    "removeChildNodePermission" : false,
    "renameFilePermission" : false,
    "shareFilePermission" : false,
    "uploadPermission" : false,
    "viewPermission" : true
  }
}

Example Responses

Status code: 200

Response body.

{
  "code" : 0,
  "msg" : "success"
}

Status Codes

Status Code

Description

200

Response body.