mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-08 04:00:51 +08:00
Fix bug in getUserOrganization()
This commit is contained in:
@@ -140,11 +140,7 @@ class UserEditPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getUserOrganization() {
|
getUserOrganization() {
|
||||||
if (this.state.user === null || this.state.organizations.length === 0) {
|
return this.state.application?.organizationObj;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.state.organizations.filter(organization => organization.name === this.state.user.owner)[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isGroupsVisible() {
|
isGroupsVisible() {
|
||||||
@@ -157,6 +153,10 @@ class UserEditPage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getGroups(organizationName) {
|
getGroups(organizationName) {
|
||||||
|
if (!Setting.isLocalAdminUser(this.props.account)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isGroupsVisible()) {
|
if (this.isGroupsVisible()) {
|
||||||
GroupBackend.getGroups(organizationName)
|
GroupBackend.getGroups(organizationName)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
Reference in New Issue
Block a user