feat: support global admin to modify the email and phone of other users (#633)

Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
Yixiang Zhao
2022-03-30 20:27:23 +08:00
committed by GitHub
parent 24459d852e
commit 0fc0ba0c76
2 changed files with 11 additions and 3 deletions

View File

@ -304,7 +304,7 @@ func UpdateUser(id string, user *User, columns []string, isGlobalAdmin bool) boo
"is_admin", "is_global_admin", "is_forbidden", "is_deleted", "hash", "is_default_avatar", "properties"}
}
if isGlobalAdmin {
columns = append(columns, "name")
columns = append(columns, "name", "email", "phone")
}
affected, err := adapter.Engine.ID(core.PK{owner, name}).Cols(columns...).Update(user)