Skip to content

Commit 71d12b1

Browse files
authored
Participant valid (#188)
* throw error if engagement type participant roles don't match the allowed values in the config * invert participant check
1 parent 5f5fc51 commit 71d12b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/redhat/labs/lodestar/service/EngagementService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public Engagement update(Engagement engagement) {
201201
Set<String> allowed = configService.getParticipantOptions(engagement.getType()).keySet();
202202
String errors = "";
203203
for(EngagementUser p : engagement.getEngagementUsers()) {
204-
if(allowed.contains(p.getRole())) {
204+
if(!allowed.contains(p.getRole())) {
205205
errors += String.format("Participant %s has invalid role %s. ", p.getEmail(), p.getRole());
206206
LOGGER.error("Participant {} has invalid role {} for engagement type {} - {}", p.getEmail(), p.getRole(), engagement.getType(), engagement.getUuid());
207207
}

0 commit comments

Comments
 (0)