fix: close module access lifecycle gaps
This commit is contained in:
@@ -76,6 +76,10 @@ const PROGRAMMING_ROUTE_PREFIXES = [
|
||||
'/projects',
|
||||
'/sessions',
|
||||
'/models',
|
||||
] as const;
|
||||
|
||||
const PROGRAMMING_PROVIDER_ROUTE_PREFIXES = [
|
||||
...PROGRAMMING_ROUTE_PREFIXES,
|
||||
'/settings',
|
||||
] as const;
|
||||
|
||||
@@ -87,6 +91,10 @@ export function isAiModuleAllowed(moduleId: AiModuleId, access: ModuleAccess): b
|
||||
return access[moduleAccessKeyById[moduleId]];
|
||||
}
|
||||
|
||||
export function isProgrammingProviderRoute(pathname: string): boolean {
|
||||
return PROGRAMMING_PROVIDER_ROUTE_PREFIXES.some((route) => matchesRoute(pathname, route));
|
||||
}
|
||||
|
||||
export function getGuardedAiModuleForPath(pathname: string): AiModuleId | null {
|
||||
if (pathname === '/image-canvas'
|
||||
|| pathname.startsWith('/image-canvas/')
|
||||
|
||||
Reference in New Issue
Block a user