1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 04:10:47 +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:
王健辉
2021-09-13 10:37:07 +08:00
committed by GitHub
parent 1f68680257
commit 07df610e43
60 changed files with 1965 additions and 287 deletions

View File

@@ -13,10 +13,17 @@ const propTypes = {
translateExplanation: PropTypes.func,
onOptionChanged: PropTypes.func.isRequired,
toggleItemFreezed: PropTypes.func,
enableAddCustomPermission: PropTypes.bool,
onAddCustomPermissionToggle: PropTypes.func,
};
class SelectEditor extends React.Component {
static defaultProps = {
enableAddCustomPermission: false,
}
constructor(props) {
super(props);
this.state = {
@@ -45,6 +52,21 @@ class SelectEditor extends React.Component {
this.options.push(option);
}
const { enableAddCustomPermission } = this.props;
if (enableAddCustomPermission) {
const option = {
value: gettext('Add custom permission'),
isDisabled: true,
label: (
<div className="btn-add-custom-permission" onClick={this.props.onAddCustomPermissionToggle}>
<i className="fa fa-plus"></i>
<span>{gettext('Add custom permission')}</span>
</div>
)
};
this.options.push(option);
}
this.setState({
options: this.options
});