From 0aa166f9ca4addae233bf067d57cca5515d5d09c Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Thu, 29 Feb 2024 16:10:29 -0300 Subject: [PATCH] [dbt] br_cnj_improbidade_administrativa (#473) * add hook --- .../br_cnj_improbidade_administrativa__condenacao.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/models/br_cnj_improbidade_administrativa/br_cnj_improbidade_administrativa__condenacao.sql b/models/br_cnj_improbidade_administrativa/br_cnj_improbidade_administrativa__condenacao.sql index 0cf1b9c0..7e52b69d 100644 --- a/models/br_cnj_improbidade_administrativa/br_cnj_improbidade_administrativa__condenacao.sql +++ b/models/br_cnj_improbidade_administrativa/br_cnj_improbidade_administrativa__condenacao.sql @@ -3,9 +3,14 @@ schema="br_cnj_improbidade_administrativa", alias="condenacao", materialized="table", + post_hook=[ + 'CREATE OR REPLACE ROW ACCESS POLICY allusers_filter ON {{this}} GRANT TO ("allUsers") FILTER USING (DATE_DIFF(CURRENT_DATE(), data_propositura, MONTH) > 6)', + 'CREATE OR REPLACE ROW ACCESS POLICY bdpro_filter ON {{this}} GRANT TO ("group:bd-pro@basedosdados.org", "group:sudo@basedosdados.org") FILTER USING (True)', + ], ) }} + select safe_cast(nome as string) nome, safe_cast(num_processo as string) numero_processo,