Skip to content

Commit

Permalink
fix: implement explicit setting of roles
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Feb 5, 2024
1 parent 53b8249 commit c786966
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ public void deleteParticipant(@PathParam("participantId") String participantId,
@Path("/{participantId}/roles")
@RolesAllowed(ServicePrincipal.ROLE_ADMIN)
public void updateRoles(@PathParam("participantId") String participantId, List<String> roles) {
participantContextService.updateParticipant(participantId, participantContext -> {
participantContext.getRoles().clear();
participantContext.getRoles().addAll(roles);
}).orElseThrow(exceptionMapper(ParticipantContext.class, participantId));
participantContextService.updateParticipant(participantId, participantContext -> participantContext.setRoles(roles)).orElseThrow(exceptionMapper(ParticipantContext.class, participantId));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public List<String> getRoles() {
return roles;
}

public void setRoles(List<String> roles) {
this.roles = roles;
}

@JsonPOJOBuilder(withPrefix = "")
public static final class Builder extends ParticipantResource.Builder<ParticipantContext, Builder> {

Expand Down

0 comments on commit c786966

Please sign in to comment.