fix: admin-navigatie zichtbaar voor ADMIN-rol gebruikers
- requireAdmin() checkt nu de database i.p.v. session.isAdmin (was altijd undefined)
- loginAction stelt session.isAdmin in op basis van UserRole in de DB
- registerAction stelt session.isAdmin = false expliciet in
- NavBar toont 'Admin'-link conditioneel als roles.includes('ADMIN')
- UserMenu ROLE_LABELS uitgebreid met ADMIN → 'Admin'
- Tests aangepast: prismaUserRole.findFirst mock toegevoegd
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c3f10cccce
commit
fbf58d4e44
6 changed files with 26 additions and 2 deletions
|
|
@ -142,6 +142,7 @@ export function NavBar({
|
|||
{navLink('/insights', 'Insights', pathname.startsWith('/insights'))}
|
||||
{navLink('/ideas', 'Ideeën', pathname.startsWith('/ideas'))}
|
||||
{navLink('/todos', "Todo's", pathname.startsWith('/todos'))}
|
||||
{roles.includes('ADMIN') && navLink('/admin', 'Admin', pathname.startsWith('/admin'))}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ const ROLE_LABELS: Record<string, string> = {
|
|||
PRODUCT_OWNER: 'Product Owner',
|
||||
SCRUM_MASTER: 'Scrum Master',
|
||||
DEVELOPER: 'Developer',
|
||||
ADMIN: 'Admin',
|
||||
}
|
||||
|
||||
interface UserMenuProps {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue