mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:37:31 +00:00
fix: new es bug fixes (#1477)
* fix: displayname on members * fix: user grant update * fix: user grant id * console grantid Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
@@ -500,3 +500,11 @@ func (u *UserView) ComputeMFAMaxSetUp() {
|
||||
}
|
||||
u.MFAMaxSetUp = int32(req_model.MFALevelNotSetUp)
|
||||
}
|
||||
|
||||
func (u *UserView) SetEmptyUserType() {
|
||||
if u.MachineView != nil && u.MachineView.Name == "" {
|
||||
u.MachineView = nil
|
||||
} else {
|
||||
u.HumanView = nil
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ func UserByID(db *gorm.DB, table, userID string) (*model.UserView, error) {
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-sj8Sw", "Errors.User.NotFound")
|
||||
}
|
||||
user.SetEmptyUserType()
|
||||
return user, err
|
||||
}
|
||||
|
||||
@@ -28,6 +29,7 @@ func UserByUserName(db *gorm.DB, table, userName string) (*model.UserView, error
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-Lso9s", "Errors.User.NotFound")
|
||||
}
|
||||
user.SetEmptyUserType()
|
||||
return user, err
|
||||
}
|
||||
|
||||
@@ -43,6 +45,7 @@ func UserByLoginName(db *gorm.DB, table, loginName string) (*model.UserView, err
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-AD4qs", "Errors.User.NotFound")
|
||||
}
|
||||
user.SetEmptyUserType()
|
||||
return user, err
|
||||
}
|
||||
|
||||
@@ -63,6 +66,7 @@ func UserByLoginNameAndResourceOwner(db *gorm.DB, table, loginName, resourceOwne
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-AD4qs", "Errors.User.NotFoundOnOrg")
|
||||
}
|
||||
user.SetEmptyUserType()
|
||||
return user, err
|
||||
}
|
||||
|
||||
@@ -121,6 +125,7 @@ func GetGlobalUserByLoginName(db *gorm.DB, table, loginName string) (*model.User
|
||||
if caos_errs.IsNotFound(err) {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "VIEW-8uWer", "Errors.User.NotFound")
|
||||
}
|
||||
user.SetEmptyUserType()
|
||||
return user, err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user