D1 · FIRS Tax Management System
Navigation declared as data, filtered by role
- Problem
- Four kinds of user share one dashboard application, and each should be offered only the areas that apply to them.
- Approach
- Every navigation entry lists the roles allowed to see it. An entry with no list is open to every role. The sidebar filters this one list against the signed-in user's role, which is held in the Redux session store.
- Trade-offs
- The rules sit in one reviewable place, and adding a role or a page is a change to data, not to components. The list decides what the interface offers. Which data a role may fetch is a separate concern outside the frontend code reviewed, so the replica below does not model it.
- Outcome
- One configuration drives the sidebar for all four roles.