mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 22:54:11 +00:00
fix list wiki department permission (#6301)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext, username, canPublishRepo } from '../../utils/constants';
|
||||
import { gettext, username, canPublishRepo, isPro } from '../../utils/constants';
|
||||
import WikiCardGroup from './wiki-card-group';
|
||||
import wikiAPI from '../../utils/wiki-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
@@ -8,6 +8,8 @@ import toaster from '../toast';
|
||||
|
||||
import './wiki-card-view.css';
|
||||
|
||||
const { multiTenancy, cloudMode } = window.app.pageOptions;
|
||||
|
||||
const propTypes = {
|
||||
data: PropTypes.object.isRequired,
|
||||
deleteWiki: PropTypes.func.isRequired,
|
||||
@@ -22,10 +24,11 @@ class WikiCardView extends Component {
|
||||
this.state = {
|
||||
departmentMap: {},
|
||||
};
|
||||
this.isDepartment = isPro && multiTenancy && cloudMode;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (!canPublishRepo) return;
|
||||
if (!canPublishRepo || !this.isDepartment) return;
|
||||
let departmentMap = {};
|
||||
wikiAPI.listWikiDepartments().then(res => {
|
||||
res.data.forEach(item => departmentMap[item.id] = true);
|
||||
|
Reference in New Issue
Block a user