From 4506e17e4977c8b5d2cac31821b7c8dadc771cf5 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Wed, 17 Dec 2025 02:23:46 -0800 Subject: [PATCH] fix: update navigation role names to match Prisma schema (STAFF/GROWER vs WORKER/CULTIVATOR) --- frontend/src/lib/navigation.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/navigation.ts b/frontend/src/lib/navigation.ts index 715d5e6..b77e4b3 100644 --- a/frontend/src/lib/navigation.ts +++ b/frontend/src/lib/navigation.ts @@ -24,10 +24,10 @@ import { * Navigation configuration with RBAC support */ -export type UserRole = 'VIEWER' | 'WORKER' | 'CULTIVATOR' | 'MANAGER' | 'ADMIN' | 'OWNER'; +export type UserRole = 'VIEWER' | 'STAFF' | 'GROWER' | 'MANAGER' | 'ADMIN' | 'OWNER'; // Role hierarchy for permission checking (higher index = more access) -const ROLE_HIERARCHY: UserRole[] = ['VIEWER', 'WORKER', 'CULTIVATOR', 'MANAGER', 'ADMIN', 'OWNER']; +const ROLE_HIERARCHY: UserRole[] = ['VIEWER', 'STAFF', 'GROWER', 'MANAGER', 'ADMIN', 'OWNER']; export interface NavItem { id: string; @@ -82,13 +82,13 @@ export const NAV_SECTIONS: NavSection[] = [ { id: 'rooms', label: 'Rooms', path: '/rooms', icon: Home }, { id: 'batches', label: 'Batches', path: '/batches', icon: Sprout }, { id: 'ipm', label: 'IPM Dashboard', shortLabel: 'IPM', path: '/ipm', icon: Shield }, - { id: 'environment', label: 'Environment', path: '/environment', icon: Thermometer, minRole: 'WORKER' }, + { id: 'environment', label: 'Environment', path: '/environment', icon: Thermometer, minRole: 'STAFF' }, ] }, { id: 'inventory', label: 'Inventory', - minRole: 'WORKER', + minRole: 'STAFF', items: [ { id: 'supplies', label: 'Supplies', path: '/supplies', icon: Package }, ] @@ -96,7 +96,7 @@ export const NAV_SECTIONS: NavSection[] = [ { id: 'workforce', label: 'Workforce', - minRole: 'WORKER', + minRole: 'STAFF', items: [ { id: 'timeclock', label: 'Time Clock', path: '/timeclock', icon: Clock }, ] @@ -112,7 +112,7 @@ export const NAV_SECTIONS: NavSection[] = [ { id: 'analytics', label: 'Analytics', - minRole: 'WORKER', + minRole: 'STAFF', items: [ { id: 'reports', label: 'Reports', path: '/reports', icon: BarChart3 }, { id: 'financial', label: 'Financial', path: '/financial', icon: DollarSign, minRole: 'MANAGER' },