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

[share] added permission check (#2900)

This commit is contained in:
llj
2019-01-29 10:06:26 +08:00
committed by Daniel Pan
parent 53f42e4283
commit d9a2f6ded9
12 changed files with 193 additions and 29 deletions

View File

@@ -177,9 +177,9 @@ class DirOperationToolbar extends React.Component {
}
render() {
let { path, isViewFile } = this.props;
let { path, isViewFile, repoName } = this.props;
let itemType = isViewFile ? 'file' : 'dir';
let itemName = isViewFile ? Utils.getFileName(path) : Utils.getFolderName(path);
let itemName = isViewFile ? Utils.getFileName(path) : (path == '/' ? repoName : Utils.getFolderName(path));
return (
<Fragment>
<div className="operation">
@@ -251,6 +251,11 @@ class DirOperationToolbar extends React.Component {
itemName={itemName}
itemPath={this.props.path}
repoID={this.props.repoID}
repoEncrypted={this.props.repoEncrypted}
enableDirPrivateShare={this.props.enableDirPrivateShare}
userPerm={this.props.userPerm}
isAdmin={this.props.isAdmin}
isGroupOwnedRepo={this.props.isGroupOwnedRepo}
toggleDialog={this.onShareClick}
/>
</ModalPortal>