Merge pull request #6618 from kobergj/MoreRoleAssignerFixing

Fix OIDC Role Assigning
This commit is contained in:
kobergj authored and GitHub committed 2023-06-26 10:44:51 +02:00
commit d0e1adccf7
2 files changed
+2 -1

No files matched your search

@@ -5,3 +5,4 @@ This makes no sense as the user is supposed to have only one and the update will
We still log an error level log to make the admin aware of that.
https://github.com/owncloud/ocis/pull/6605
https://github.com/owncloud/ocis/pull/6618
+1 -1
View File
@@ -93,7 +93,7 @@ func (ra oidcRoleAssigner) UpdateUserRoleAssignment(ctx context.Context, user *c
}
logger.Debug().Interface("assignedRoleIds", assignedRoles).Msg("Currently assigned roles")
if len(assignedRoles) == 0 || (assignedRoles[0] != roleIDFromClaim) {
if len(assignedRoles) != 1 || (assignedRoles[0] != roleIDFromClaim) {
logger.Debug().Interface("assignedRoleIds", assignedRoles).Interface("newRoleId", roleIDFromClaim).Msg("Updating role assignment for user")
newctx, err := ra.prepareAdminContext()
if err != nil {