Files
co-lite/solvway-admin-portal/app/lib/routeModules.ts
T
ngqileandClaude Opus 5.5 1071ddaa2a feat(admin-portal): cut babyboo portal down to Co-Lite login, users and roles
Removes every other screen, API route, component, test and the dependencies only
they used. Cookie colite_admin, Co-Lite branding, BO_USERS/BO_ROLES modules only.
The user form no longer loads branches, events or country scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-26 21:24:30 +08:00

18 lines
738 B
TypeScript

// Route -> required module name. Values are the seeded aclMenu `name` column (BO_USERS, ...), NOT the `desc`
// display label: the route gate RequireModule -> useAdminAuth().hasModule(x) matches a flattened aclMenu node by
// `name` or `url` only, so a desc label here never matches and a granted user would wrongly see the
// not-authorised state.
export const ROUTE_MODULES: Record<string, string> = {
"/users": "BO_USERS",
"/roles": "BO_ROLES",
};
export function requiredModuleFor(pathname: string): string | undefined {
return ROUTE_MODULES[pathname];
}
export function requiredModulesFor(pathname: string): readonly string[] | undefined {
const single = ROUTE_MODULES[pathname];
return single ? [single] : undefined;
}