Skip to content

Commit

Permalink
removed user id mapping part
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish committed Dec 11, 2024
1 parent 957742a commit 49e3cfc
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1607,8 +1607,6 @@ public String merge(String toSiteId, Element root, String archivePath, String fr
StringBuilder results = new StringBuilder();
results.append("begin merging ").append(getLabel()).append(" for site ").append(toSiteId).append(LINE_SEPARATOR);

String currentUserId = sessionManager.getCurrentSessionUserId();

if (!root.getTagName().equals(getLabel())) {
log.warn("Tried to merge a non <{}> xml document", getLabel());
return "Invalid xml document";
Expand All @@ -1631,23 +1629,9 @@ public String merge(String toSiteId, Element root, String archivePath, String fr
continue;
}

String creatorId = currentUserId;

// If the original creator of this rubric is a valid user in "this" Sakai instance,
// then use the same creator id for the new rubric. Otherwise, use the current user.
String originalCreatorId = rubricEl.getAttribute("creator");
if (StringUtils.isNotBlank(originalCreatorId)) {
try {
userDirectoryService.getUser(originalCreatorId);
creatorId = originalCreatorId;
} catch (UserNotDefinedException unde) {
log.debug("Original rubric creator {} is not a user in *this* Sakai", originalCreatorId);
}
}

RubricTransferBean rubricBean = new RubricTransferBean();
rubricBean.setOwnerId(toSiteId);
rubricBean.setCreatorId(creatorId);
rubricBean.setCreatorId(sessionManager.getCurrentSessionUserId());
rubricBean.setCreated(now);
rubricBean.setTitle(title);
rubricBean.setMaxPoints(Double.parseDouble(rubricEl.getAttribute("max-points")));
Expand Down

0 comments on commit 49e3cfc

Please sign in to comment.