diff --git a/api/src/main/java/ca/bc/gov/educ/api/edx/service/v1/EdxFileOnboardingService.java b/api/src/main/java/ca/bc/gov/educ/api/edx/service/v1/EdxFileOnboardingService.java index 71c2f4ef..af795501 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/edx/service/v1/EdxFileOnboardingService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/edx/service/v1/EdxFileOnboardingService.java @@ -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 { @@ -128,6 +129,7 @@ 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)); } @@ -135,4 +137,22 @@ private SagaEntity prepareSagaRecord(final OnboardingFileRow onboardingFileRow, return builder.build(); } + private List allowedDistrictRoles() { + List districtRoles = new ArrayList<>(); + districtRoles.add("EDX_DISTRICT_ADMIN"); + districtRoles.add("SECURE_EXCHANGE_DISTRICT"); + districtRoles.add("EDX_EDIT_DISTRICT"); + + return districtRoles; + } + + private List allowedSchoolRoles() { + List schoolRoles = new ArrayList<>(); + schoolRoles.add("EDX_SCHOOL_ADMIN"); + schoolRoles.add("SECURE_EXCHANGE_SCHOOL"); + schoolRoles.add("EDX_EDIT_SCHOOL"); + + return schoolRoles; + } + }