mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 11:00:28 +08:00
feat: fix issue that a user can belong to two physical groups at the same time (#4084)
This commit is contained in:
@@ -326,7 +326,7 @@ class UserEditPage extends React.Component {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="multiple" style={{width: "100%"}} disabled={disabled} value={this.state.user.groups ?? []} onChange={(value => {
|
<Select virtual={false} mode="multiple" style={{width: "100%"}} disabled={disabled} value={this.state.user.groups ?? []} onChange={(value => {
|
||||||
if (this.state.groups?.filter(group => value.includes(group.name))
|
if (this.state.groups?.filter(group => value.includes(`${group.owner}/${group.name}`))
|
||||||
.filter(group => group.type === "Physical").length > 1) {
|
.filter(group => group.type === "Physical").length > 1) {
|
||||||
Setting.showMessage("error", i18next.t("general:You can only select one physical group"));
|
Setting.showMessage("error", i18next.t("general:You can only select one physical group"));
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user