1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +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, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Router, navigate } from '@reach/router';
import { siteRoot } from './utils/constants';
import { siteRoot, canAddRepo } from './utils/constants';
import { Utils } from './utils/utils';
import SidePanel from './components/side-panel';
import MainPanel from './components/main-panel';
@@ -176,12 +176,17 @@ class App extends Component {
render() {
let { currentTab } = this.state;
const home = canAddRepo ?
<MyLibraries path={ siteRoot } onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} /> :
<SharedLibrariesWrapper path={ siteRoot } onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />;
return (
<div id="main">
<SidePanel isSidePanelClosed={this.state.isSidePanelClosed} onCloseSidePanel={this.onCloseSidePanel} currentTab={currentTab} tabItemClick={this.tabItemClick} draftCounts={this.state.draftCounts} />
<MainPanel>
<Router>
<MyLibraries path={ siteRoot } onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
{home}
<FilesActivitiesWrapper path={siteRoot + 'dashboard'} onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
<DraftsViewWrapper path={siteRoot + 'drafts'}
currentTab={currentTab}