do not return an error when detecting too many roles

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-06-22 17:45:01 +02:00
parent 2ea3b8c400
commit 1d0a7acc65
2 changed files with 8 additions and 3 deletions
@@ -0,0 +1,7 @@
Bugfix: Fix the oidc role assigner
The update role method did not allow to set a role when the user already has two roles.
This makes no sense as the user is supposed to have only one and the update will fix that.
We still log an error level log to make the admin aware of that.
https://github.com/owncloud/ocis/pull/6605
+1 -3
View File
@@ -89,9 +89,7 @@ func (ra oidcRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *c
return nil, err
}
if len(assignedRoles) > 1 {
err := errors.New("too many roles assigned")
logger.Error().Err(err).Msg("The user has too many roles assigned")
return nil, err
logger.Error().Str("userID", user.GetId().GetOpaqueId()).Int("numRoles", len(assignedRoles)).Msg("The user has too many roles assigned")
}
logger.Debug().Interface("assignedRoleIds", assignedRoles).Msg("Currently assigned roles")