This commit is contained in:
@@ -316,7 +316,7 @@ const EventsCalendar = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewCalendar()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -83,7 +83,7 @@ const CreateEventRequest = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -69,7 +69,7 @@ const EventRequestList = () => {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -134,7 +134,7 @@ const CreateEvent = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canEditMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -152,7 +152,7 @@ const EventsCalendar = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -137,7 +137,7 @@ const EventsList = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -96,7 +96,7 @@ const EventsMultipleList = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -200,7 +200,7 @@ const UpdateEvent = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canEditMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -27,7 +27,7 @@ const ViewEvent = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalEvents()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -145,7 +145,7 @@ const SideMenu = () => {
|
||||
name: 'Appointment One-Day List',
|
||||
link: '/medical/events/list',
|
||||
category: '/events/list',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalEvents
|
||||
},
|
||||
// {
|
||||
// name: 'Customer Report',
|
||||
|
||||
@@ -115,7 +115,7 @@ const InfoScreen = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canViewRoutes()) {
|
||||
if (!AuthService.canViewInfoScreen()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.');
|
||||
AuthService.logout();
|
||||
navigate('/login');
|
||||
|
||||
@@ -69,7 +69,7 @@ const Medical = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection() && !AuthService.canViewMedicalEvents()) {
|
||||
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
|
||||
@@ -73,7 +73,7 @@ const MedicalIndex = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection() && !AuthService.canViewMedicalEvents()) {
|
||||
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
|
||||
@@ -22,7 +22,7 @@ const TemplateManager = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert("You haven't login yet OR this user does not have access to this page. Please change an admin account to login.");
|
||||
AuthService.logout();
|
||||
navigate("/login");
|
||||
|
||||
@@ -110,7 +110,7 @@ const CreateResource = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -62,7 +62,7 @@ const ResourcesList = () => {
|
||||
}
|
||||
]);
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -132,7 +132,7 @@ const UpdateResource = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -49,7 +49,7 @@ const ViewResource = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewMedicalSection()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -55,7 +55,7 @@ const DailyTemplatesList = () => {
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
if (!AuthService.canAccessLegacySystem()) {
|
||||
if (!AuthService.canViewRoutes()) {
|
||||
window.alert('You haven\'t login yet OR this user does not have access to this page. Please change an admin account to login.')
|
||||
AuthService.logout();
|
||||
navigate(`/login`);
|
||||
|
||||
@@ -89,6 +89,22 @@ const canViewMedicalSection = () => {
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewMedicalEvents = () => {
|
||||
return hasAnyPermission([
|
||||
'View _Calendar _Medical Appointment',
|
||||
'Edit&Create _Calendar _Medical Appointment',
|
||||
'View_Appointment Calendar',
|
||||
'Edit & Create_Appointment Calendar'
|
||||
]);
|
||||
}
|
||||
|
||||
const canEditMedicalEvents = () => {
|
||||
return hasAnyPermission([
|
||||
'Edit&Create _Calendar _Medical Appointment',
|
||||
'Edit & Create_Appointment Calendar'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewMealStatus = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Meal Status',
|
||||
@@ -291,6 +307,8 @@ export const AuthService = {
|
||||
canViewCalendar,
|
||||
canViewMessaging,
|
||||
canViewMedicalSection,
|
||||
canViewMedicalEvents,
|
||||
canEditMedicalEvents,
|
||||
canViewMealStatus,
|
||||
canViewSeatingChart,
|
||||
canViewLobby,
|
||||
|
||||
Reference in New Issue
Block a user