Feature: Financial Role Access Control — Phase 4 (P2)
Story: US3 — Nav hides financial links for non-GERENTE
Update src/app/dashboard/layout.tsx:
- After existing
supabase.auth.getUser() call, add: const { data: funcionarioPerfil } = await supabase.from('funcionarios').select('role').eq('id', user.id).maybeSingle()
- Derive
const role = funcionarioPerfil?.role ?? 'RECEPCIONISTA' (fail-closed default)
- Pass
role={role} to <DashboardNav role={role} />
Depends on: T007 (DashboardNav must accept role prop)
Feature: Financial Role Access Control — Phase 4 (P2)
Story: US3 — Nav hides financial links for non-GERENTE
Update
src/app/dashboard/layout.tsx:supabase.auth.getUser()call, add:const { data: funcionarioPerfil } = await supabase.from('funcionarios').select('role').eq('id', user.id).maybeSingle()const role = funcionarioPerfil?.role ?? 'RECEPCIONISTA'(fail-closed default)role={role}to<DashboardNav role={role} />Depends on: T007 (DashboardNav must accept role prop)