From be52dea752f1577bddcd802538a4bacb6f941d5f Mon Sep 17 00:00:00 2001 From: Hristo Oskov Date: Tue, 15 Feb 2022 18:55:33 -0800 Subject: [PATCH] maybe we can just create the principal --- .../mechanic/upgrades/V3StudyMigrationUpgrade.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt b/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt index 63940cb8..06837e3c 100644 --- a/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt +++ b/src/main/kotlin/com/openlattice/mechanic/upgrades/V3StudyMigrationUpgrade.kt @@ -3,6 +3,8 @@ package com.openlattice.mechanic.upgrades import com.geekbeast.rhizome.configuration.RhizomeConfiguration import com.hazelcast.query.Predicates import com.openlattice.authorization.AclKey +import com.openlattice.authorization.Principal +import com.openlattice.authorization.PrincipalType import com.openlattice.authorization.Principals import com.openlattice.data.storage.MetadataOption import com.openlattice.data.storage.postgres.PostgresEntityDataQueryService @@ -193,16 +195,13 @@ class V3StudyMigrationUpgrade( private fun processParticipantsOfStudy(conn: Connection, orgId: UUID, studyEkid: UUID, orgStudyEntitySetIds: Set, orgMaybeParticipantEntitySetIds: Set) { - val chronicleSuperUserPrincipals = Principals.getUserPrincipals("") - logger.info("Using chronicle super user principals $chronicleSuperUserPrincipals to execute neighbour search") - val filter = EntityNeighborsFilter(setOf(studyEkid), Optional.of(orgMaybeParticipantEntitySetIds), Optional.of(orgStudyEntitySetIds), Optional.empty()) // get all participants for the study val searchResult = searchService.executeEntityNeighborSearch( orgStudyEntitySetIds, PagedNeighborRequest(filter), - chronicleSuperUserPrincipals + setOf(Principal(PrincipalType.USER, "")) ).neighbors.getOrDefault(studyEkid, listOf()) if (searchResult.isNotEmpty()) {