This commit is contained in:
@@ -85,6 +85,7 @@ import Dashboard from "./components/dashboard/Dashboard";
|
||||
import AdminView from "./components/admin-view/AdminView";
|
||||
|
||||
import InfoScreen from './components/info-screen/InfoScreen';
|
||||
import { AuthService } from "./services";
|
||||
|
||||
function App() {
|
||||
const [showMenu, setShowMenu] = useState(false);
|
||||
@@ -258,7 +259,7 @@ function App() {
|
||||
<Route path="template" element={<TemplateManager />} />
|
||||
</Route>
|
||||
|
||||
<Route path="/info-screen" element={<InfoScreen />} />
|
||||
<Route path="/info-screen" element={AuthService.canViewInfoScreen() ? <InfoScreen /> : <Navigate to="/home-empty" replace />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
</Router>
|
||||
|
||||
@@ -14,7 +14,7 @@ const SideMenu = () => {
|
||||
icon: <Grid1x2 color="#777" size={14}/>,
|
||||
name: 'Dashboard',
|
||||
collapsed: false,
|
||||
roleFunc: () => true,
|
||||
roleFunc: () => AuthService.canViewDashboard() || AuthService.canViewAdminView(),
|
||||
subNavs: [
|
||||
{
|
||||
name: 'Dashboard',
|
||||
|
||||
@@ -168,12 +168,7 @@ const canViewVehicleAny = () => canViewVehicleBasic() || canViewVehicleDocuments
|
||||
const canEditVehicleAny = () => canEditVehicleBasic() || canEditVehicleDocuments() || canEditVehicleRepairs() || canAddVehicle() || canArchiveVehicle() || canDeleteVehicle();
|
||||
|
||||
const canViewDashboard = () => {
|
||||
return hasAnyPermission([
|
||||
'Dashboard',
|
||||
'View_Transportation Schedule_Route Overview',
|
||||
'Create&Edit_Transportation Schedule',
|
||||
'Export_Transportation Schedule Report'
|
||||
]);
|
||||
return hasPermission('Dashboard');
|
||||
}
|
||||
|
||||
const canViewInfoScreen = () => {
|
||||
|
||||
Reference in New Issue
Block a user