mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-12 14:30:19 -05:00
do not return an error when detecting too many roles
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -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
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user