Skip to content

Commit

Permalink
ModelRestController.java: removed sout, added TODO in addObject
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Sep 14, 2020
1 parent 3f70dfd commit 66ca017
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -286,7 +286,6 @@ public ResponseEntity<?> getSelf() {

try {
FocusType loggedInUser = SecurityUtil.getPrincipal().getFocus();
System.out.println("loggedInUser = " + loggedInUser);
PrismObject<UserType> user = model.getObject(UserType.class, loggedInUser.getOid(), null, task, parentResult);
response = createResponse(HttpStatus.OK, user, parentResult, true);
parentResult.recordSuccessIfUnknown();
Expand Down Expand Up @@ -388,7 +387,8 @@ public <T extends ObjectType> ResponseEntity<?> searchObjectsByType(
@PutMapping("/{type}/{id}")
public <T extends ObjectType> ResponseEntity<?> addObject(
@PathVariable("type") String type,
@PathVariable("id") String id, // TODO is it OK that this is not used or at least asserted?
// TODO is it OK that this is not used or at least asserted?
@SuppressWarnings("unused") @PathVariable("id") String id,
@RequestParam(value = "options", required = false) List<String> options,
@RequestBody @NotNull PrismObject<T> object) {
logger.debug("model rest service for add operation start");
Expand All @@ -407,10 +407,11 @@ public <T extends ObjectType> ResponseEntity<?> addObject(

ModelExecuteOptions modelExecuteOptions = ModelExecuteOptions.fromRestOptions(options, prismContext);
if (modelExecuteOptions == null) {
modelExecuteOptions = ModelExecuteOptions.create(prismContext).overwrite();
} else if (!ModelExecuteOptions.isOverwrite(modelExecuteOptions)) {
modelExecuteOptions.overwrite(Boolean.TRUE);
modelExecuteOptions = ModelExecuteOptions.create(prismContext);
}
// TODO: Do we want to overwrite in any case? Because of PUT?
// This was original logic... and then there's that ignored ID.
modelExecuteOptions.overwrite();

String oid;
ResponseEntity<?> response;
Expand Down

0 comments on commit 66ca017

Please sign in to comment.