Skip to content

Commit

Permalink
Migrating Okta users to the DB with no facilities (#8469)
Browse files Browse the repository at this point in the history
* updating logic for no facilities

* removing unnecessary exception catching
  • Loading branch information
DavidMcClatchey authored Feb 6, 2025
1 parent 965382b commit 96618b3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,12 @@ private ApiUser setRolesAndFacilities(Optional<OrganizationRoles> orgRoles, ApiU
.map(IdentifiedEntity::getInternalId)
.collect(Collectors.toList());
Set<Facility> facilitiesToGiveAccessTo =
getFacilitiesToGiveAccess(org, roles, new HashSet<>(facilitiesInternalIds));
facilitiesInternalIds.isEmpty()
? new HashSet<>()
: getFacilitiesToGiveAccess(org, roles, new HashSet<>(facilitiesInternalIds));
apiUser.setFacilities(facilitiesToGiveAccessTo);
apiUser.setRoles(roles, org);
} catch (MisconfiguredUserException | PrivilegeUpdateFacilityAccessException e) {
} catch (MisconfiguredUserException e) {
log.warn(
"Could not migrate roles and facilities for user with id={}", apiUser.getInternalId());
}
Expand Down

0 comments on commit 96618b3

Please sign in to comment.