Merge pull request #6605 from kobergj/FixUpdateRolesAssigner

Fix OIDC role assigner
This commit is contained in:
kobergj authored and GitHub committed 2023-06-23 10:32:34 +02:00
commit 76c3e3c024
2 files changed
+8 -3

No files matched your search

@@ -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")