From 016ce888675f43f314aef3438fdc616801001cba Mon Sep 17 00:00:00 2001 From: pvannierop Date: Fri, 15 Nov 2024 12:15:47 +0100 Subject: [PATCH 1/2] Improve efficiency of permission request caching --- .../kotlin/org/radarbase/gateway/io/AvroRecordProcessor.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radar-gateway/src/main/kotlin/org/radarbase/gateway/io/AvroRecordProcessor.kt b/radar-gateway/src/main/kotlin/org/radarbase/gateway/io/AvroRecordProcessor.kt index 15d7163..c30f3e3 100644 --- a/radar-gateway/src/main/kotlin/org/radarbase/gateway/io/AvroRecordProcessor.kt +++ b/radar-gateway/src/main/kotlin/org/radarbase/gateway/io/AvroRecordProcessor.kt @@ -67,15 +67,15 @@ class AvroRecordProcessor( for (entity in this) { // Make sure to perform the permission check on entities only once. - // Note: + if (entitiesChecked.contains(entity)) continue + // There is a 'feature' around the comparison of EntityDetails objects; the checkPermissions method // updates the EntityDetails object with the organization id. This means that for effective comparison // we have to make copy of entity details so that the original entity details are compared. Without // this every entity processed here would be considered as an entity different from all previous and // would trigger a new permission check. This situation is a consequence of the later addition of the // concept of organization to the entity details. - val entityCheck = entity.copy() - if (!entitiesChecked.add(entityCheck)) continue + entitiesChecked.add(entity.copy()) authService.checkPermission( Permission.MEASUREMENT_CREATE, From 3e67ea612f3100f91e9eacaf0788d16062d650ee Mon Sep 17 00:00:00 2001 From: pvannierop Date: Fri, 15 Nov 2024 12:16:28 +0100 Subject: [PATCH 2/2] Set project version to 0.7.6 --- buildSrc/src/main/kotlin/Versions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 2158d8d..7d58bee 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,6 +1,6 @@ @Suppress("ConstPropertyName") object Versions { - const val project = "0.7.5" + const val project = "0.7.6" const val java = 17 const val kotlin = "1.9.22"