feat(servers): cru added in to the server and dynamically updates vms036

This commit is contained in:
2025-10-07 06:46:02 -05:00
parent d49c8807d0
commit 90610c4ce2
11 changed files with 239 additions and 23 deletions

View File

@@ -5,9 +5,13 @@ import { requireAuth } from "../../pkg/middleware/authMiddleware.js";
import users from "./routes/getUserRoles.js";
import grantRoles from "./routes/grantRole.js";
import servers from "./routes/servers/serverRoutes.js";
import { restrictToHosts } from "../../pkg/middleware/restrictToHosts.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
@@ -18,11 +22,4 @@ export const setupAdminRoutes = (app: Express, basePath: string) => {
requireAuth("user", ["systemAdmin", "admin"]), // will pass bc system admin but this is just telling us we need this
grantRoles
);
app.use(
basePath + "/api/admin/server",
requireAuth("user", ["systemAdmin", "admin"]), // will pass bc system admin but this is just telling us we need this
restrictToHosts(["usmcd1vms036", "USMCD1VMS036"]), // what servers are allowed to see the server section
servers
);
};