import type { Express, Request, Response } from "express"; import { requireAuth } from "../../pkg/middleware/authMiddleware.js"; //admin routes import users from "./routes/getUserRoles.js"; import grantRoles from "./routes/grantRole.js"; import servers from "./routes/servers/serverRoutes.js"; export const setupAdminRoutes = (app: Express, basePath: string) => { app.use( basePath + "/api/admin/server", // will pass bc system admin but this is just telling us we need this servers ); app.use( basePath + "/api/admin/users", requireAuth("user", ["systemAdmin"]), // will pass bc system admin but this is just telling us we need this users ); app.use( basePath + "/api/admin", requireAuth("user", ["systemAdmin", "admin"]), // will pass bc system admin but this is just telling us we need this grantRoles ); };