feat: fix function CheckAccountItemModifyRule (#1789)

* feat: fix function CheckAccountItemModifyRule

* fix: admin changes its own username

* fix: current user changes its own username

* Update user.go

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
Yaodong Yu
2023-04-26 16:21:58 +08:00
committed by GitHub
parent 95f4f4cb6d
commit 6c2b172aae
2 changed files with 4 additions and 1 deletions

View File

@ -216,7 +216,7 @@ func CheckAccountItemModifyRule(accountItem *AccountItem, isAdmin bool, lang str
switch accountItem.ModifyRule {
case "Admin":
if isAdmin {
if !isAdmin {
return false, fmt.Sprintf(i18n.Translate(lang, "organization:Only admin can modify the %s."), accountItem.Name)
}
case "Immutable":