mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-07 02:20:28 +08:00
feat: support inserting user's field to SAML attribute (#4105)
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user