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