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:
@@ -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}
|
||||
|
Reference in New Issue
Block a user