This commit is contained in:
@@ -276,11 +276,13 @@ const Dashboard = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Customer List Section */}
|
{/* Customer List Section */}
|
||||||
<div className="row">
|
{AuthService.canViewCustomers() && (
|
||||||
<div className="col-12">
|
<div className="row">
|
||||||
<DashboardCustomersList />
|
<div className="col-12">
|
||||||
|
<DashboardCustomersList />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right Side Bar - 1/4 width */}
|
{/* Right Side Bar - 1/4 width */}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const SideMenu = () => {
|
|||||||
name: 'Dashboard',
|
name: 'Dashboard',
|
||||||
link: '/dashboard/dashboard',
|
link: '/dashboard/dashboard',
|
||||||
category: '/dashboard/dashboard',
|
category: '/dashboard/dashboard',
|
||||||
roleFunc: AuthService.canViewRoutes
|
roleFunc: AuthService.canViewDashboard
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Admin View',
|
name: 'Admin View',
|
||||||
|
|||||||
@@ -35,6 +35,15 @@ const hasAnyPermission = (permissionKeys = []) => {
|
|||||||
return permissionKeys.some((permissionKey) => permissionSet.has(permissionKey));
|
return permissionKeys.some((permissionKey) => permissionSet.has(permissionKey));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const canViewDashboard = () => {
|
||||||
|
return hasAnyPermission([
|
||||||
|
'Dashboard',
|
||||||
|
'View_Transportation Schedule_Route Overview',
|
||||||
|
'Create&Edit_Transportation Schedule',
|
||||||
|
'Export_Transportation Schedule Report'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
const isAdmin = () => {
|
const isAdmin = () => {
|
||||||
return hasPermission('Set Permission for Employee');
|
return hasPermission('Set Permission for Employee');
|
||||||
}
|
}
|
||||||
@@ -214,6 +223,7 @@ export const AuthService = {
|
|||||||
login,
|
login,
|
||||||
logout,
|
logout,
|
||||||
hasPermission,
|
hasPermission,
|
||||||
|
canViewDashboard,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
canCreateOrEditDrivers,
|
canCreateOrEditDrivers,
|
||||||
getLocalAccessToken,
|
getLocalAccessToken,
|
||||||
|
|||||||
Reference in New Issue
Block a user