1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 01:12:03 +00:00

forbid new folder & new file in container for someone who not has permission

This commit is contained in:
shanshuirenjia
2019-06-24 11:28:25 +08:00
parent ba39bfe176
commit 01df690b19
7 changed files with 48 additions and 29 deletions

View File

@@ -198,6 +198,12 @@ class TreeView extends React.Component {
}
onContextMenu = (event) => {
event.preventDefault();
let currentRepoInfo = this.props.currentRepoInfo;
if (currentRepoInfo.permission !== 'admin' && currentRepoInfo.permission !== 'rw') {
return '';
}
this.handleContextClick(event);
}
@@ -208,12 +214,6 @@ class TreeView extends React.Component {
if (!this.props.isNodeMenuShow) {
return;
}
let currentRepoInfo = this.props.currentRepoInfo;
if (currentRepoInfo.permission === 'cloud-edit' || currentRepoInfo.permission === 'preview') {
return '';
}
let x = event.clientX || (event.touches && event.touches[0].pageX);
let y = event.clientY || (event.touches && event.touches[0].pageY);