From b86b64c0a6e6700bd0e7640ab1cc3ef5189f1940 Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Tue, 15 Feb 2022 19:33:56 -0800 Subject: [PATCH] chronicleSuperUserPrincipals --- .../mechanic/upgrades/V3StudyMigrationUpgrade.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt b/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt index 8d4b4cf6..dabdd7c7 100644 --- a/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt +++ b/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt @@ -197,11 +197,15 @@ class V3StudyMigrationUpgrade( val filter = EntityNeighborsFilter(setOf(studyEkid), Optional.of(orgMaybeParticipantEntitySetIds), Optional.of(orgStudyEntitySetIds), Optional.empty()) + val chronicleSuperUserSecurablePrincipal = principalService.getSecurablePrincipal("") + val chronicleSuperUserPrincipals = principalService.getAllPrincipals(chronicleSuperUserSecurablePrincipal).map { it.principal }.toSet() + logger.info("chronicle super user principals ${chronicleSuperUserPrincipals.size} $chronicleSuperUserPrincipals") + // get all participants for the study val searchResult = searchService.executeEntityNeighborSearch( orgStudyEntitySetIds, PagedNeighborRequest(filter), - setOf(Principal(PrincipalType.USER, "")) + chronicleSuperUserPrincipals ).neighbors.getOrDefault(studyEkid, listOf()) if (searchResult.isNotEmpty()) {