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";