fix(cloudid): support custom saml user name (#15511)

This commit is contained in:
屈轩
2022-12-08 14:41:56 +08:00
committed by GitHub
parent 843714f922
commit 28baa2c6a7
+6 -2
View File
@@ -128,10 +128,14 @@ func (manager *SSamluserManager) ValidateCreateData(ctx context.Context, userCre
return input, errors.Wrapf(err, "FetchUserById")
}
input.OwnerId = user.Id
input.Name = user.Name
if len(input.Name) == 0 {
input.Name = user.Name
}
} else {
input.OwnerId = userCred.GetUserId()
input.Name = userCred.GetUserName()
if len(input.Name) == 0 {
input.Name = userCred.GetUserName()
}
}
_group, err := validators.ValidateModel(userCred, CloudgroupManager, &input.CloudgroupId)
if err != nil {