apps/recallassess/recallassess-api/src/config/navigation/types/navigation.types.ts
Extended navigation item with role-based access control Extends the base NavigationItem from @bish-nest/core
NavigationItem
Properties |
|
| allowedRoles |
allowedRoles:
|
Type : ParticipantRole[]
|
| Optional |
|
Roles that can access this navigation item If empty or undefined, accessible to all authenticated users |
| children |
children:
|
Type : RoleBasedNavigationItem[]
|
| Optional |
|
Children items (for collapsable/group types) |
| featureFlags |
featureFlags:
|
Type : string[]
|
| Optional |
|
Feature flags for conditional rendering Can be expanded for A/B testing, feature toggling, etc. |
| metadata |
metadata:
|
Type : literal type
|
| Optional |
|
Additional metadata for extensibility |
| permissions |
permissions:
|
Type : string[]
|
| Optional |
|
Custom permissions (for future expansion) Can be used for more granular access control |
import { NavigationItem } from "@bish-nest/core";
/**
* Participant roles that can access navigation items
* Maps to ParticipantRole enum in Prisma schema
*/
export enum ParticipantRole {
PARTICIPANT = "PARTICIPANT",
PARTICIPANT_ADMIN = "PARTICIPANT_ADMIN",
}
/**
* Extended navigation item with role-based access control
* Extends the base NavigationItem from @bish-nest/core
*/
export interface RoleBasedNavigationItem extends NavigationItem {
/**
* Roles that can access this navigation item
* If empty or undefined, accessible to all authenticated users
*/
allowedRoles?: ParticipantRole[];
/**
* Feature flags for conditional rendering
* Can be expanded for A/B testing, feature toggling, etc.
*/
featureFlags?: string[];
/**
* Custom permissions (for future expansion)
* Can be used for more granular access control
*/
permissions?: string[];
/**
* Additional metadata for extensibility
*/
metadata?: {
/**
* Badge configuration for notifications, counts, etc.
*/
badge?: {
title: string;
classes: string;
};
/**
* Analytics tracking ID
*/
trackingId?: string;
/**
* Help/tooltip text
*/
helpText?: string;
/**
* Is this a beta/new feature?
*/
isBeta?: boolean;
/**
* Any other custom metadata
*/
[key: string]: unknown;
};
/**
* Children items (for collapsable/group types)
*/
children?: RoleBasedNavigationItem[];
}
/**
* Navigation configuration with role-based items
*/
export interface RoleBasedNavigationConfig {
name: string;
items: RoleBasedNavigationItem[];
}