1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

Merge branch '7.0'

This commit is contained in:
lian
2019-12-04 10:02:06 +08:00
6 changed files with 184 additions and 112 deletions

View File

@@ -116,7 +116,7 @@ export const Utils = {
}
},
getShareLinkPermissionList: function(itemType, permission, path) {
getShareLinkPermissionList: function(itemType, permission = null, path, canEdit = null) {
// itemType: library, dir, file
// permission: rw, r, admin, cloud-edit, preview
@@ -139,12 +139,15 @@ export const Utils = {
if (permission == 'rw' || permission == 'admin' || permission == 'r') {
permissionOptions.push(downloadOption);
}
if (this.isEditableOfficeFile(path) && (permission == 'rw' || permission == 'admin')) {
if (this.isEditableOfficeFile(path) && (permission == 'rw' || permission == 'admin') && canEdit) {
permissionOptions.push(editDownloadOption);
}
if (this.isEditableOfficeFile(path) && (permission == 'cloud-edit')) {
permissionOptions.push(editOnly);
}
// not support
// if (this.isEditableOfficeFile(path) && (permission == 'cloud-edit')) {
// permissionOptions.push(editOnly);
// }
}
return permissionOptions;
},