1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

return repo/folder permission when get share link list (#4319)

* return repo/folder permission when get share link list

* update permission check when create/update share link

* optimized code

* optimized code

* add can_edit valid

* return can_edit field when get share link list
This commit is contained in:
杨顺强
2019-12-03 13:52:52 +08:00
committed by Daniel Pan
parent c3a6ada019
commit 50e0618a7d
5 changed files with 180 additions and 113 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;
},