1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

change permission on share pop up (#4386)

* change permission on share pop up

* update

* add Utils.getShareLinkPermissionStr
This commit is contained in:
lian
2020-01-02 12:05:50 +08:00
committed by Daniel Pan
parent 71a988e116
commit b67033c73d
3 changed files with 66 additions and 22 deletions

View File

@@ -155,6 +155,23 @@ export const Utils = {
return permissionOptions;
},
getShareLinkPermissionStr: function(permissions) {
const { can_edit, can_download } = permissions;
if (can_edit) {
if (can_download) {
return 'edit_download';
} else {
return 'cloud_edit';
}
} else {
if (can_download) {
return 'preview_download';
} else {
return 'preview_only';
}
}
},
isEditableOfficeFile: function(filename) {
// no file ext
if (filename.lastIndexOf('.') == -1) {