WIP - permissions

This commit is contained in:
Francisco Gaona
2025-12-28 05:43:03 +01:00
parent f4143ab106
commit 88f656c3f5
35 changed files with 3040 additions and 53 deletions

View File

@@ -1,14 +1,15 @@
import Knex from 'knex';
import type { Knex as KnexType } from 'knex';
import { Model } from 'objection';
import { CentralTenant, CentralDomain, CentralUser } from '../models/central.model';
let centralKnex: Knex.Knex | null = null;
let centralKnex: KnexType | null = null;
/**
* Get or create a Knex instance for the central database
* This is used for Objection models that work with central entities
*/
export function getCentralKnex(): Knex.Knex {
export function getCentralKnex(): KnexType {
if (!centralKnex) {
const centralDbUrl = process.env.CENTRAL_DATABASE_URL;