Applied RBAC to compliance dashboard
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user