mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
fix: fix account items display error (#2781)
This commit is contained in:
parent
e4b25055d5
commit
d988ac814c
@ -251,22 +251,8 @@ class UserEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
renderAccountItem(accountItem) {
|
renderAccountItem(accountItem) {
|
||||||
if (!accountItem.visible) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isAdmin = Setting.isLocalAdminUser(this.props.account);
|
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;
|
let disabled = false;
|
||||||
if (accountItem.modifyRule === "Self") {
|
if (accountItem.modifyRule === "Self") {
|
||||||
if (!this.isSelfOrAdmin()) {
|
if (!this.isSelfOrAdmin()) {
|
||||||
@ -1023,6 +1009,21 @@ class UserEditPage extends React.Component {
|
|||||||
<Form>
|
<Form>
|
||||||
{
|
{
|
||||||
this.getUserOrganization()?.accountItems?.map(accountItem => {
|
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 (
|
return (
|
||||||
<React.Fragment key={accountItem.name}>
|
<React.Fragment key={accountItem.name}>
|
||||||
<Form.Item name={accountItem.name}
|
<Form.Item name={accountItem.name}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user