mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 19:58:11 +00:00
user permition
This commit is contained in:
@@ -216,13 +216,13 @@ const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[] => [
|
||||
label: "First Mile",
|
||||
href: "/dashboard/operations/first-mile",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.trainScheduling.view,
|
||||
permission: FREIGHT_PERMS.firstMile.view,
|
||||
},
|
||||
{
|
||||
label: "Last Mile",
|
||||
href: "/dashboard/operations/last-mile",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.trainScheduling.view,
|
||||
permission: FREIGHT_PERMS.lastMile.view,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -233,7 +233,7 @@ const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[] => [
|
||||
label: "Fleet Dashboard",
|
||||
href: "/dashboard/fleet-dashboard",
|
||||
icon: <LayoutDashboard />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.fleetDashboard.view,
|
||||
},
|
||||
{
|
||||
label: "Routes",
|
||||
@@ -263,43 +263,43 @@ const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[] => [
|
||||
label: "Vehicles",
|
||||
href: "/dashboard/vehicles",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.vehicles.view,
|
||||
},
|
||||
{
|
||||
label: "Drivers",
|
||||
href: "/dashboard/drivers",
|
||||
icon: <Users />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.drivers.view,
|
||||
},
|
||||
{
|
||||
label: "Track Vehicles",
|
||||
href: "/dashboard/tracking",
|
||||
icon: <MapPin />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.tracking.view,
|
||||
},
|
||||
{
|
||||
label: "Fuel Purchases",
|
||||
href: "/dashboard/fuel-purchases",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.fuel.view,
|
||||
},
|
||||
{
|
||||
label: "Fuel Analytics",
|
||||
href: "/dashboard/fuel-stats",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.fuel.view,
|
||||
},
|
||||
{
|
||||
label: "Maintenance",
|
||||
href: "/dashboard/maintenance",
|
||||
icon: <Truck />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.maintenance.view,
|
||||
},
|
||||
{
|
||||
label: "Work Orders",
|
||||
href: "/dashboard/work-orders",
|
||||
icon: <SlidersHorizontal />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.maintenance.view,
|
||||
},
|
||||
{
|
||||
label: "Compliance & Alerts",
|
||||
@@ -323,7 +323,7 @@ const buildSidebarSections = (demoItems: SidebarItem[]): SidebarSection[] => [
|
||||
label: "Financial Reports",
|
||||
href: "/dashboard/financial-reports",
|
||||
icon: <Wallet />,
|
||||
permission: FREIGHT_PERMS.fleet.view,
|
||||
permission: FREIGHT_PERMS.fleetReports.view,
|
||||
},
|
||||
// {
|
||||
// label: "Containers",
|
||||
@@ -896,7 +896,7 @@ const App = () => {
|
||||
<Route
|
||||
path="operations/first-mile"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.trainScheduling.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.firstMile.view}>
|
||||
<FirstMilePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -904,7 +904,7 @@ const App = () => {
|
||||
<Route
|
||||
path="operations/last-mile"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.trainScheduling.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.lastMile.view}>
|
||||
<LastMilePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1000,7 +1000,7 @@ const App = () => {
|
||||
<Route
|
||||
path="vehicles"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.vehicles.view}>
|
||||
<FleetResourcePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ const App = () => {
|
||||
<Route
|
||||
path="vehicles/:id"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.vehicles.view}>
|
||||
<VehicleDetailPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ const App = () => {
|
||||
<Route
|
||||
path="drivers"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.drivers.view}>
|
||||
<FleetResourcePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ const App = () => {
|
||||
<Route
|
||||
path="drivers/:id"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.drivers.view}>
|
||||
<DriverDetailPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1086,7 +1086,7 @@ const App = () => {
|
||||
<Route
|
||||
path="fuel-purchases"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.fuel.view}>
|
||||
<FuelPurchasePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1094,7 +1094,7 @@ const App = () => {
|
||||
<Route
|
||||
path="fuel-stats"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.fuel.view}>
|
||||
<FuelStatsPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1102,7 +1102,7 @@ const App = () => {
|
||||
<Route
|
||||
path="maintenance"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.maintenance.view}>
|
||||
<MaintenancePage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1110,7 +1110,7 @@ const App = () => {
|
||||
<Route
|
||||
path="financial-reports"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleetReports.view}>
|
||||
<FinancialReportsPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1118,7 +1118,7 @@ const App = () => {
|
||||
<Route
|
||||
path="fleet-dashboard"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleetDashboard.view}>
|
||||
<FleetDashboard />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ const App = () => {
|
||||
<Route
|
||||
path="tracking"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.tracking.view}>
|
||||
<TrackingPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ const App = () => {
|
||||
<Route
|
||||
path="work-orders"
|
||||
element={
|
||||
<RequirePermission permission={FREIGHT_PERMS.fleet.view}>
|
||||
<RequirePermission permission={FREIGHT_PERMS.maintenance.view}>
|
||||
<WorkOrdersPage />
|
||||
</RequirePermission>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user