mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-12 21:30:39 +00:00
change permission on share pop up (#4386)
* change permission on share pop up * update * add Utils.getShareLinkPermissionStr
This commit is contained in:
@@ -112,27 +112,13 @@ class Item extends Component {
|
||||
let itemType = item.is_dir ? (item.path === '/' ? 'library' : 'dir') : 'file';
|
||||
let permission = item.repo_folder_permission;
|
||||
let permissionOptions = Utils.getShareLinkPermissionList(itemType, permission, item.path, item.can_edit);
|
||||
let currentPermission = this.getCurrentPermission();
|
||||
let currentPermission = Utils.getShareLinkPermissionStr(this.props.item.permissions);
|
||||
this.setState({
|
||||
permissionOptions: permissionOptions,
|
||||
currentPermission: currentPermission
|
||||
});
|
||||
}
|
||||
|
||||
getCurrentPermission = () => {
|
||||
const { can_edit, can_download } = this.props.item.permissions;
|
||||
switch (`${can_edit} ${can_download}`) {
|
||||
case 'false true':
|
||||
return 'preview_download';
|
||||
case 'false false':
|
||||
return 'preview_only';
|
||||
case 'true true':
|
||||
return 'edit_download';
|
||||
case 'true false':
|
||||
return 'cloud_edit';
|
||||
}
|
||||
}
|
||||
|
||||
toggleOpMenu = () => {
|
||||
this.setState({
|
||||
isOpMenuOpen: !this.state.isOpMenuOpen
|
||||
|
Reference in New Issue
Block a user