patch
All checks were successful
Build And Deploy Main / build-and-deploy (push) Successful in 36s

This commit is contained in:
2026-03-11 11:43:27 -04:00
parent f39bcf4c16
commit 5489dbf327
20 changed files with 37 additions and 19 deletions

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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',

View File

@@ -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');

View File

@@ -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();

View File

@@ -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();

View File

@@ -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");

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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`);

View File

@@ -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,