Applied RBAC to compliance dashboard

This commit is contained in:
2026-10-22 16:06:05 +02:00
parent efc63ca398
commit 3fda1ac5db
2 changed files with 8 additions and 1 deletions
@@ -62,6 +62,7 @@ export const ROLE_CLAIM_MAP: Record<string, RoleClaim[]> = {
admin: ['unrestricted'],
executive: [
'dashboard',
'compliance',
'governance',
'projects_milestones',
'grant_financials',
@@ -70,6 +71,7 @@ export const ROLE_CLAIM_MAP: Record<string, RoleClaim[]> = {
],
supervisor: [
'dashboard',
'compliance',
'projects_milestones',
'grant_financials',
'evidence_risks',
@@ -81,6 +83,7 @@ export const ROLE_CLAIM_MAP: Record<string, RoleClaim[]> = {
],
manager: [
'dashboard',
'compliance',
'projects_milestones',
'grant_financials',
'evidence_risks',
@@ -393,6 +396,7 @@ export const ClaimProtectedRoute: React.FC<{
if (!allowed) {
let fallbackPath = '/dashboard';
if (canView('dashboard')) fallbackPath = '/dashboard';
else if (canView('compliance')) fallbackPath = '/compliance';
else if (canView('projects_milestones')) fallbackPath = '/projects';
else if (canView('grant_financials')) fallbackPath = '/grants';
else if (canView('evidence_risks')) fallbackPath = '/monitoring';