}
static void createManagerUser(AdminUserSection adminSection, SchoolSetupSection schoolSetupSection) {
User adminUser = User.findByUsername(adminSection.getAdminUsername());
final Person person = new Person(adminUser.getProfile());
RoleType.grant(RoleType.SCIENTIFIC_COUNCIL, adminUser);
RoleType.grant(RoleType.PERSONNEL_SECTION, adminUser);
RoleType.grant(RoleType.DEPARTMENT_ADMINISTRATIVE_OFFICE, adminUser);
RoleType.grant(RoleType.SPACE_MANAGER, adminUser);
RoleType.grant(RoleType.SPACE_MANAGER_SUPER_USER, adminUser);
RoleType.grant(RoleType.ACADEMIC_ADMINISTRATIVE_OFFICE, adminUser);
RoleType.grant(RoleType.BOLONHA_MANAGER, adminUser);
person.setCountry(Country.readDefault());
person.setCountryOfBirth(Country.readDefault());
EmailAddress.createEmailAddress(person, adminSection.getAdminUserEmail(), PartyContactType.PERSONAL, true, true, true,
true);
for (PartyContact partyContact : person.getPartyContactsSet()) {
partyContact.setValid();
partyContact.getPartyContactValidation().setState(PartyContactValidationState.VALID);
}
Authenticate.mock(adminUser);
AcademicOperationType.MANAGE_AUTHORIZATIONS.grant(adminUser);