1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

User perm check (#2876)

* added 'user permission check'

* added 'can add repo' check

* [dir view, repo wiki mode] added condition check for 'share current dir'

* [dir view, repo wiki mode] modified var name
This commit is contained in:
llj
2019-01-24 10:02:18 +08:00
committed by Daniel Pan
parent 123a442319
commit 6e99897335
12 changed files with 96 additions and 27 deletions

View File

@@ -1,7 +1,7 @@
import React,{ Fragment } from 'react';
import { Popover } from 'reactstrap';
import PropTypes from 'prop-types';
import { gettext, siteRoot, username, loginUrl } from '../../utils/constants';
import { gettext, siteRoot, username, loginUrl, canAddRepo } from '../../utils/constants';
import { Link } from '@reach/router';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
@@ -331,9 +331,11 @@ class GroupView extends React.Component {
<div className="cur-view-toolbar border-left-show">
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
<div className="operation">
{canAddRepo && (
<button className="btn btn-secondary operation-item" title={gettext('New Library')} onClick={this.onCreateRepoToggle}>
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Library')}
</button>
)}
</div>
</div>
<CommonToolbar onSearchedClick={this.props.onSearchedClick} />