This commit is contained in:
@@ -60,6 +60,13 @@ export function WorkspacePage() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [currentProcess?.id, loadLatestForProcess])
|
||||
|
||||
// client_viewer no puede editar — redirigir al reporte
|
||||
useEffect(() => {
|
||||
if (user?.platformRole === 'client_viewer') {
|
||||
void navigate({ to: '/report/$processId', params: { processId } })
|
||||
}
|
||||
}, [user, processId, navigate])
|
||||
|
||||
// Validación XOR: todos los gateways exclusivos deben sumar 1.0
|
||||
const xorValidation = useMemo(() => {
|
||||
const invalidIds = gateways
|
||||
@@ -153,7 +160,7 @@ export function WorkspacePage() {
|
||||
|
||||
// isLoading manda siempre, incluso si currentProcess todavía tiene el proceso
|
||||
// anterior en el store (navegación directa entre dos workspaces distintos).
|
||||
if (isLoading) {
|
||||
if (isLoading || user?.platformRole === 'client_viewer') {
|
||||
return <WorkspaceSkeleton />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user