use of com.khartec.waltz.model.involvement.EntityInvolvementChangeCommand in project waltz by khartec.
the class InvolvementEndpoint method updateEntityInvolvement.
private Boolean updateEntityInvolvement(Request request) throws java.io.IOException {
EntityReference entityReference = getEntityReference(request);
requireEditRoleForEntity(userRoleService, request, entityReference.kind());
EntityInvolvementChangeCommand command = readBody(request, EntityInvolvementChangeCommand.class);
String username = getUsername(request);
switch(command.operation()) {
case ADD:
return service.addEntityInvolvement(username, entityReference, command);
case REMOVE:
return service.removeEntityInvolvement(username, entityReference, command);
default:
throw new UnsupportedOperationException("Command operation: " + command.operation() + " is not supported");
}
}
Aggregations