fix: remove isGlobalAdmin field in user (#2235)

* refactor: remove isGlobalAdmin field in user

* fix: upload xlsx

* fix: remove field in account table
This commit is contained in:
Yaodong Yu
2023-08-19 12:23:15 +08:00
committed by GitHub
parent a07216d0e1
commit e5a189e0f4
28 changed files with 212 additions and 763 deletions

View File

@ -141,7 +141,7 @@ func checkSigninErrorTimes(user *User, lang string) string {
// reset the error times
user.SigninWrongTimes = 0
UpdateUser(user.GetId(), user, []string{"signin_wrong_times"}, user.IsGlobalAdmin)
UpdateUser(user.GetId(), user, []string{"signin_wrong_times"}, false)
}
return ""
@ -319,7 +319,7 @@ func CheckUserPermission(requestUserId, userId string, strict bool, lang string)
if requestUser == nil {
return false, fmt.Errorf(i18n.Translate(lang, "check:Session outdated, please login again"))
}
if requestUser.IsGlobalAdmin {
if requestUser.IsGlobalAdmin() {
hasPermission = true
} else if requestUserId == userId {
hasPermission = true