fix: update navigation role names to match Prisma schema (STAFF/GROWER vs WORKER/CULTIVATOR)
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

This commit is contained in:
fullsizemalt 2025-12-17 02:23:46 -08:00
parent ac50b7a9d9
commit 4506e17e49

View file

@ -24,10 +24,10 @@ import {
* Navigation configuration with RBAC support * 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) // 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 { export interface NavItem {
id: string; id: string;
@ -82,13 +82,13 @@ export const NAV_SECTIONS: NavSection[] = [
{ id: 'rooms', label: 'Rooms', path: '/rooms', icon: Home }, { id: 'rooms', label: 'Rooms', path: '/rooms', icon: Home },
{ id: 'batches', label: 'Batches', path: '/batches', icon: Sprout }, { id: 'batches', label: 'Batches', path: '/batches', icon: Sprout },
{ id: 'ipm', label: 'IPM Dashboard', shortLabel: 'IPM', path: '/ipm', icon: Shield }, { 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', id: 'inventory',
label: 'Inventory', label: 'Inventory',
minRole: 'WORKER', minRole: 'STAFF',
items: [ items: [
{ id: 'supplies', label: 'Supplies', path: '/supplies', icon: Package }, { id: 'supplies', label: 'Supplies', path: '/supplies', icon: Package },
] ]
@ -96,7 +96,7 @@ export const NAV_SECTIONS: NavSection[] = [
{ {
id: 'workforce', id: 'workforce',
label: 'Workforce', label: 'Workforce',
minRole: 'WORKER', minRole: 'STAFF',
items: [ items: [
{ id: 'timeclock', label: 'Time Clock', path: '/timeclock', icon: Clock }, { id: 'timeclock', label: 'Time Clock', path: '/timeclock', icon: Clock },
] ]
@ -112,7 +112,7 @@ export const NAV_SECTIONS: NavSection[] = [
{ {
id: 'analytics', id: 'analytics',
label: 'Analytics', label: 'Analytics',
minRole: 'WORKER', minRole: 'STAFF',
items: [ items: [
{ id: 'reports', label: 'Reports', path: '/reports', icon: BarChart3 }, { id: 'reports', label: 'Reports', path: '/reports', icon: BarChart3 },
{ id: 'financial', label: 'Financial', path: '/financial', icon: DollarSign, minRole: 'MANAGER' }, { id: 'financial', label: 'Financial', path: '/financial', icon: DollarSign, minRole: 'MANAGER' },