Skip to content

Commit 8ef2483

Browse files
authored
Repositioned harmonized consent path escaping logic (#175)
The fence_harmonized_concept_path was being escaped twice and it was causing the JSON structure to break when creating a new MANUAL role.
1 parent b5e322f commit 8ef2483

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pic-sure-auth-services/src/main/java/edu/harvard/hms/dbmi/avillach/auth/service/auth/FENCEAuthenticationService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ public Response getFENCEProfile(String callback_url, Map<String, String> authReq
202202
throw new NotAuthorizedException("The user details could not be persisted. Please contact the administrator.");
203203
}
204204

205-
if (fence_harmonized_concept_path != null && !fence_harmonized_concept_path.contains("\\\\")) {
206-
fence_harmonized_concept_path = fence_harmonized_concept_path.replaceAll("\\\\", "\\\\\\\\");
207-
logger.debug("Escaped harmonized consent path: {}", fence_harmonized_concept_path);
208-
}
205+
209206

210207
// Update the user's roles (or create them if none exists)
211208
//Set<Role> actual_user_roles = u.getRoles();
@@ -502,6 +499,10 @@ private Privilege upsertClinicalPrivilege(String studyIdentifier, String project
502499
logger.debug("Escaped consent concept path: {}", consent_concept_path);
503500
}
504501

502+
if (fence_harmonized_concept_path != null && !fence_harmonized_concept_path.contains("\\\\")) {
503+
fence_harmonized_concept_path = fence_harmonized_concept_path.replaceAll("\\\\", "\\\\\\\\");
504+
logger.debug("Escaped harmonized consent path: {}", fence_harmonized_concept_path);
505+
}
505506

506507
String studyIdentifierField = (consent_group != null && !consent_group.isEmpty()) ? studyIdentifier + "." + consent_group : studyIdentifier;
507508
String queryTemplateText = String.format(

0 commit comments

Comments
 (0)