import {Modules} from "@/types/modules"; type User = { user_id: string; email: string; username: string; roles: keyof Roles[]; role: string; }; interface Roles { role: string; } // user will need access to the module. // users role will determine there visual access export function hasAccess(user: User | null, moduleName: string | null, modules: Modules[]): boolean { // get the modules for the id const filteredModule = modules?.filter((f) => f.name === moduleName); console.log(filteredModule); // userroles and filter out by the module id, console.log(user); return false; }