mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
custom share permission (#4967)
* custom share permission * remove path field * add permission manager ui * optimize custom permission manager style * add permission setting * add normalize_custom_permission_name * optimize repo custom permission * delete useless code * optimize code * optimize code * optimize markdown file page * fix a few bugs * add permission control * repair modify permission * optimize style * optimize copyright * add try-except * optimize code * move file&folder * batch operation item * repair batch move item * update copyright * optimize move permission control * optimize code * optimize code * optimize code & fix code wranning * optimize code * delete unsupport permission * optimize code * repair code bug * add pro limit * optimize code * add permission handle for permission editor * repair new file&folder bug * optimize file uploader code * custom permission user can not visit custom permission module * optimize code * forbid comment&detail module * optimize code * optimize modify/preview permission * optimize custom permission share perm * optimize view file module: file-toolbar * optimize custom drag move operation * repair column view bug * optimize drag operation code * repair code bug * optimize code Co-authored-by: shanshuirenjia <978987373@qq.com>
This commit is contained in:
@@ -26,9 +26,14 @@ const propTypes = {
|
||||
dragAndDrop: PropTypes.bool.isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
onFileUploadSuccess: PropTypes.func.isRequired,
|
||||
isCustomPermission: PropTypes.bool,
|
||||
};
|
||||
|
||||
class FileUploader extends React.Component {
|
||||
|
||||
static defaultProps = {
|
||||
isCustomPermission: false
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -181,15 +186,18 @@ class FileUploader extends React.Component {
|
||||
}
|
||||
|
||||
onFileAdded = (resumableFile, files) => {
|
||||
const { isCustomPermission } = this.props;
|
||||
let isFile = resumableFile.fileName === resumableFile.relativePath;
|
||||
// uploading is file and only upload one file
|
||||
if (isFile && files.length === 1) {
|
||||
let hasRepetition = false;
|
||||
let direntList = this.props.direntList;
|
||||
for (let i = 0; i < direntList.length; i++) {
|
||||
if (direntList[i].type === 'file' && direntList[i].name === resumableFile.fileName) {
|
||||
hasRepetition = true;
|
||||
break;
|
||||
if (!isCustomPermission) {
|
||||
let direntList = this.props.direntList;
|
||||
for (let i = 0; i < direntList.length; i++) {
|
||||
if (direntList[i].type === 'file' && direntList[i].name === resumableFile.fileName) {
|
||||
hasRepetition = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasRepetition) {
|
||||
|
Reference in New Issue
Block a user