From 6b6217377b79f70e91b11e11678aa7c5bd651cf9 Mon Sep 17 00:00:00 2001 From: prv-proton Date: Fri, 3 Jan 2025 14:20:25 -0800 Subject: [PATCH] updates --- etl/nifi_scripts/user.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etl/nifi_scripts/user.groovy b/etl/nifi_scripts/user.groovy index bc8910f11..4c6ce85c2 100644 --- a/etl/nifi_scripts/user.groovy +++ b/etl/nifi_scripts/user.groovy @@ -60,7 +60,7 @@ def userRoleQuery = """ GROUP BY user_profile_id, organization_id ), ProcessedRoles AS ( - SELECT + SELECT user_profile_id, CASE -- Rule 1: Government Users @@ -88,9 +88,9 @@ def userRoleQuery = """ -- Rule 2: Supplier Users WHEN organization_id > 1 THEN CASE - -- Remove government roles and retain Read Only if it exists + -- Return empty array if READ_ONLY exists WHEN 'READ_ONLY' = ANY(roles) THEN - ARRAY['READ_ONLY'] + ARRAY[]::text[] ELSE ARRAY( SELECT UNNEST(roles) EXCEPT