Skip to content

[T008] [US3] Fetch role in DashboardLayout and pass to DashboardNav #50

@EmiyaKiritsugu3

Description

@EmiyaKiritsugu3

Feature: Financial Role Access Control — Phase 4 (P2)
Story: US3 — Nav hides financial links for non-GERENTE

Update src/app/dashboard/layout.tsx:

  1. After existing supabase.auth.getUser() call, add: const { data: funcionarioPerfil } = await supabase.from('funcionarios').select('role').eq('id', user.id).maybeSingle()
  2. Derive const role = funcionarioPerfil?.role ?? 'RECEPCIONISTA' (fail-closed default)
  3. Pass role={role} to <DashboardNav role={role} />

Depends on: T007 (DashboardNav must accept role prop)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions