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(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -83,7 +83,7 @@ const CreateEventRequest = () => {
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -69,7 +69,7 @@ const EventRequestList = () => {
]); ]);
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -134,7 +134,7 @@ const CreateEvent = () => {
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -152,7 +152,7 @@ const EventsCalendar = () => {
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -137,7 +137,7 @@ const EventsList = () => {
}; };
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -96,7 +96,7 @@ const EventsMultipleList = () => {
}; };
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -200,7 +200,7 @@ const UpdateEvent = () => {
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -27,7 +27,7 @@ const ViewEvent = () => {
} }
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -145,7 +145,7 @@ const SideMenu = () => {
name: 'Appointment One-Day List', name: 'Appointment One-Day List',
link: '/medical/events/list', link: '/medical/events/list',
category: '/events/list', category: '/events/list',
roleFunc: AuthService.canAccessLegacySystem roleFunc: AuthService.canViewMedicalEvents
}, },
// { // {
// name: 'Customer Report', // name: 'Customer Report',

View File

@@ -115,7 +115,7 @@ const InfoScreen = () => {
} }
useEffect(() => { 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.'); 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(); AuthService.logout();
navigate('/login'); navigate('/login');

View File

@@ -69,7 +69,7 @@ const Medical = () => {
} }
useEffect(() => { 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.') 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(); AuthService.logout();

View File

@@ -73,7 +73,7 @@ const MedicalIndex = () => {
} }
useEffect(() => { 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.') 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(); AuthService.logout();

View File

@@ -22,7 +22,7 @@ const TemplateManager = () => {
}; };
useEffect(() => { 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."); 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(); AuthService.logout();
navigate("/login"); navigate("/login");

View File

@@ -110,7 +110,7 @@ const CreateResource = () => {
}; };
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -62,7 +62,7 @@ const ResourcesList = () => {
} }
]); ]);
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -132,7 +132,7 @@ const UpdateResource = () => {
} }
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -49,7 +49,7 @@ const ViewResource = () => {
} }
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); navigate(`/login`);

View File

@@ -55,7 +55,7 @@ const DailyTemplatesList = () => {
]; ];
useEffect(() => { 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.') 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(); AuthService.logout();
navigate(`/login`); 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 = () => { const canViewMealStatus = () => {
return hasAnyPermission([ return hasAnyPermission([
'View_Meal Status', 'View_Meal Status',
@@ -291,6 +307,8 @@ export const AuthService = {
canViewCalendar, canViewCalendar,
canViewMessaging, canViewMessaging,
canViewMedicalSection, canViewMedicalSection,
canViewMedicalEvents,
canEditMedicalEvents,
canViewMealStatus, canViewMealStatus,
canViewSeatingChart, canViewSeatingChart,
canViewLobby, canViewLobby,