Set User.groups to []

This commit is contained in:
Yang Luo
2023-06-19 09:42:17 +08:00
parent d0ac265c91
commit 29fc820578
2 changed files with 7 additions and 0 deletions

View File

@ -216,6 +216,9 @@ func refineUser(user *User) *User {
if user.Permissions == nil { if user.Permissions == nil {
user.Permissions = []*Permission{} user.Permissions = []*Permission{}
} }
if user.Groups == nil {
user.Groups = []string{}
}
return user return user
} }

View File

@ -781,6 +781,10 @@ func ExtendUserWithRolesAndPermissions(user *User) (err error) {
return err return err
} }
if user.Groups == nil {
user.Groups = []string{}
}
return return
} }