Compare commits

...

3 Commits

3 changed files with 25 additions and 16 deletions

View File

@ -161,6 +161,11 @@ func isAllowedInDemoMode(subOwner string, subName string, method string, urlPath
return true
}
return false
} else if urlPath == "/api/upload-resource" {
if subOwner == "app" && subName == "app-casibase" {
return true
}
return false
} else {
return false
}

View File

@ -18,7 +18,7 @@ import {Helmet} from "react-helmet";
import * as Setting from "./Setting";
import {StyleProvider, legacyLogicalPropertiesTransformer} from "@ant-design/cssinjs";
import {GithubOutlined, InfoCircleFilled, ShareAltOutlined} from "@ant-design/icons";
import {Alert, Button, ConfigProvider, Drawer, FloatButton, Layout, Result, Tooltip} from "antd";
import {Alert, Button, ConfigProvider, Drawer, FloatButton, Layout, Result, Spin, Tooltip} from "antd";
import {Route, Switch, withRouter} from "react-router-dom";
import CustomGithubCorner from "./common/CustomGithubCorner";
import * as Conf from "./Conf";
@ -366,7 +366,10 @@ class App extends Component {
<FloatButton.BackTop />
<CustomGithubCorner />
{
<Suspense fallback={<div>loading</div>}>
<Suspense fallback={
<div className="loginBackground" style={{height: "100vh"}}>
<Spin size="large" spinning={true} tip={i18next.t("login:Loading")} style={{margin: "0 auto"}} />
</div>}>
<Layout id="parent-area">
<ManagementPage
account={this.state.account}

View File

@ -251,22 +251,8 @@ class UserEditPage extends React.Component {
};
renderAccountItem(accountItem) {
if (!accountItem.visible) {
return null;
}
const isAdmin = Setting.isLocalAdminUser(this.props.account);
if (accountItem.viewRule === "Self") {
if (!this.isSelfOrAdmin()) {
return null;
}
} else if (accountItem.viewRule === "Admin") {
if (!isAdmin) {
return null;
}
}
let disabled = false;
if (accountItem.modifyRule === "Self") {
if (!this.isSelfOrAdmin()) {
@ -1023,6 +1009,21 @@ class UserEditPage extends React.Component {
<Form>
{
this.getUserOrganization()?.accountItems?.map(accountItem => {
if (!accountItem.visible) {
return null;
}
const isAdmin = Setting.isLocalAdminUser(this.props.account);
if (accountItem.viewRule === "Self") {
if (!this.isSelfOrAdmin()) {
return null;
}
} else if (accountItem.viewRule === "Admin") {
if (!isAdmin) {
return null;
}
}
return (
<React.Fragment key={accountItem.name}>
<Form.Item name={accountItem.name}