1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

Revert "Update menu permission valid (#4602)" (#4603)

This reverts commit 3d52a272ae.
This commit is contained in:
Daniel Pan
2020-06-24 16:11:53 +08:00
committed by GitHub
parent 3d52a272ae
commit 73c9e967c1
4 changed files with 33 additions and 39 deletions

View File

@@ -163,6 +163,10 @@ class DirOperationToolbar extends React.Component {
render() {
let { path, repoName, userPerm } = this.props;
if (userPerm !== 'rw' && userPerm !== 'admin') {
return '';
}
let itemType = path === '/' ? 'library' : 'dir';
let itemName = path == '/' ? repoName : Utils.getFolderName(path);
@@ -193,7 +197,6 @@ class DirOperationToolbar extends React.Component {
return (
<Fragment>
{(userPerm === 'rw' || userPerm === 'admin') && (
<div className="dir-operation">
<div className="operation">
{content}
@@ -216,7 +219,6 @@ class DirOperationToolbar extends React.Component {
</ul>
)}
</div>
)}
{Utils.isDesktop() && <ViewModeToolbar currentMode={this.props.currentMode} switchViewMode={this.props.switchViewMode} />}
{this.state.isCreateFileDialogShow && (
<ModalPortal>

View File

@@ -328,21 +328,19 @@ class MultipleDirOperationToolbar extends React.Component {
let direntPath = this.getDirentPath(dirent);
if (userPerm !== 'rw' && userPerm !== 'admin') {
return '';
}
return (
<Fragment>
<div className="dir-operation">
<div className="d-flex">
<ButtonGroup className="flex-row group-operations">
{(userPerm === 'rw' || userPerm === 'admin') && (
<Fragment>
<Button className="secondary group-op-item action-icon sf2-icon-move" title={gettext('Move')} onClick={this.onMoveToggle}></Button>
<Button className="secondary group-op-item action-icon sf2-icon-copy" title={gettext('Copy')} onClick={this.onCopyToggle}></Button>
<Button className="secondary group-op-item action-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onItemsDelete}></Button>
</Fragment>
)}
{(userPerm === 'rw' || userPerm === 'admin' || userPerm === 'r') && (
<Button className="secondary group-op-item action-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemsDownload}></Button>
)}
{this.props.selectedDirentList.length === 1 &&
<ItemDropdownMenu
tagName={'button'}

View File

@@ -5,7 +5,6 @@
display: flex;
flex: 1;
align-items: center;
height: 32px;
}
.border-left-show:before {

View File

@@ -54,11 +54,6 @@ const propTypes = {
class LibContentToolbar extends React.Component {
render() {
if (!this.props.userPerm) {
return <div className="cur-view-toolbar"></div>
}
if (this.props.isViewFile) {
return (
<Fragment>