Skip to main content

collab_permission

Collaboration Permission

Get Permission

You can get the collaboration permission with the collaboration.getPermission() API.

Example

await collaboration.getPermission(): Promise<Permission>

This function returns an instance of Permission.

Update Permission

You can update Collaboration permission with the collaboration.updatePermission() API.

collaboration.updatePermission(permissionOption:{ isDocPublic?: boolean,isAllowComment?:boolean }): Promise<boolean>

  • isDocPublic (boolean): Sets whether or not the document can be allowed to open by everyone. True means allowed; false means not allowed.

  • isAllowComment (boolean): Sets whether or not the document can be allowed to add comments. True means allowed; false means not allowed.

Modify the permissions for the current collaboration:

await collaboration.updatePermission({ isDocPublic?: boolean,isAllowComment?:boolean })
tip

1:This action can only be executed by the creator of the collaboration, and other members do not have permissions.

2:This action only takes effect for the joined collaboration members after the permission changed.

3:If you want to set different permissions for different participants, you can also set them through the updateMemberPermission method.

Update Member Permission

You can update collaboration member permission with the collaboration.updateMemberPermission API.

Modify the isAllowComment permission of a collaboration member through the member id:

collaboration.updateMemberPermission(members): Promise<boolean>
tip

1:This action can only be executed by the creator of the collaboration, and other members do not have permissions.

2:When permissions updated, collaborators will receive an update notification to get the latest permissions.

3:The isAllowComment permission of updateMemberPermission will override the isAllowComment permission of updatePermission.