From 132a73483277d2b27d27f555a182ff4e3185007e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Mar 2026 13:54:55 -0300 Subject: [PATCH] fix(superset): RLS por tenantId no guest token + uuid no schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Aplica cláusula tenant_id no RLS do Superset para isolamento por tenant - Adiciona uuid ao import do drizzle-orm/pg-core no schema --- server/superset/routes.ts | 2 +- shared/schema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/superset/routes.ts b/server/superset/routes.ts index 729b76e..4e08a0d 100644 --- a/server/superset/routes.ts +++ b/server/superset/routes.ts @@ -52,7 +52,7 @@ export function registerSupersetRoutes(app: Express): void { last_name: user?.name?.split(" ").slice(1).join(" ") || "User", }, resources: [{ type: "dashboard", id: dashboardId }], - rls: [], + rls: user?.tenantId ? [{ clause: `tenant_id = ${user.tenantId}`, type: "BASE_ROLE" }] : [], }), }); diff --git a/shared/schema.ts b/shared/schema.ts index 66183a0..1db158a 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -1,5 +1,5 @@ import { sql } from "drizzle-orm"; -import { pgTable, text, varchar, primaryKey, serial, integer, timestamp, numeric, jsonb, boolean, date } from "drizzle-orm/pg-core"; +import { pgTable, text, varchar, primaryKey, serial, integer, timestamp, numeric, jsonb, boolean, date, uuid } from "drizzle-orm/pg-core"; import { createInsertSchema } from "drizzle-zod"; import { z } from "zod";