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