feat: support inserting user's field to SAML attribute (#4105)

This commit is contained in:
DacongDA
2025-08-22 11:27:21 +08:00
committed by GitHub
parent 09b389b1f7
commit a0e2be7ba8
2 changed files with 68 additions and 6 deletions

View File

@@ -248,6 +248,20 @@ func SetUserOAuthProperties(organization *Organization, user *User, providerType
return UpdateUserForAllFields(user.GetId(), user)
}
func getUserRoleNames(user *User) (res []string) {
for _, role := range user.Roles {
res = append(res, role.Name)
}
return res
}
func getUserPermissionNames(user *User) (res []string) {
for _, permission := range user.Permissions {
res = append(res, permission.Name)
}
return res
}
func ClearUserOAuthProperties(user *User, providerType string) (bool, error) {
for k := range user.Properties {
prefix := fmt.Sprintf("oauth_%s_", providerType)