Skip to content

Commit

Permalink
Update EdxFileOnboardingService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
SodhiA1 committed Dec 14, 2023
1 parent 711acc2 commit 920f00c
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ private SagaEntity prepareSagaRecord(final OnboardingFileRow onboardingFileRow,
payload.setMincode(onboardingFileRow.getMincode());
payload.setSchoolName(displayName);
payload.setSchoolID(schoolID);
payload.getEdxActivationRoleCodes().addAll(this.allowedSchoolRoles());
builder.sagaName(ONBOARD_SCHOOL_USER_SAGA.toString());
builder.payload(JsonUtil.getJsonStringFromObject(payload));
} else {
Expand All @@ -128,11 +129,30 @@ private SagaEntity prepareSagaRecord(final OnboardingFileRow onboardingFileRow,
payload.setMincode(onboardingFileRow.getMincode());
payload.setDistrictName(displayName);
payload.setDistrictID(districtID);
payload.getEdxActivationRoleCodes().addAll(this.allowedDistrictRoles());
builder.sagaName(ONBOARD_DISTRICT_USER_SAGA.toString());
builder.payload(JsonUtil.getJsonStringFromObject(payload));
}

return builder.build();
}

private List<String> allowedDistrictRoles() {
List<String> districtRoles = new ArrayList<>();
districtRoles.add("EDX_DISTRICT_ADMIN");
districtRoles.add("SECURE_EXCHANGE_DISTRICT");
districtRoles.add("EDX_EDIT_DISTRICT");

return districtRoles;
}

private List<String> allowedSchoolRoles() {
List<String> schoolRoles = new ArrayList<>();
schoolRoles.add("EDX_SCHOOL_ADMIN");
schoolRoles.add("SECURE_EXCHANGE_SCHOOL");
schoolRoles.add("EDX_EDIT_SCHOOL");

return schoolRoles;
}

}

0 comments on commit 920f00c

Please sign in to comment.