refactor(server): moved the server files outside the src to improve static files

This commit is contained in:
2025-03-01 15:23:42 -06:00
parent d3acdfb481
commit 89a2b3ea9e
28 changed files with 4592 additions and 2253 deletions

View File

@@ -0,0 +1,15 @@
/*
pass over a users uuid and return all modules they have permission too.
in the login route we attach it to user under roles.
*/
import {eq} from "drizzle-orm";
import {db} from "../../../../database/dbclient.js";
import {userRoles} from "../../../../database/schema/userRoles.js";
export const roleCheck = async (user_id: any) => {
// get the user roles by the user_id
const roles = await db.select().from(userRoles).where(eq(userRoles.user_id, user_id));
return roles;
};