This commit is contained in:
@@ -34,13 +34,13 @@ const SideMenu = () => {
|
||||
icon: <Display color="#777" size={14}/>,
|
||||
name: 'Info Screen',
|
||||
link: '/info-screen',
|
||||
roleFunc: () => true
|
||||
roleFunc: AuthService.canViewInfoScreen
|
||||
},
|
||||
{
|
||||
icon: <Person color="#777" size={14}/>,
|
||||
name: 'General',
|
||||
collapsed: false,
|
||||
roleFunc: () => true,
|
||||
roleFunc: () => AuthService.canViewCustomers() || AuthService.canViewCalendar() || AuthService.canViewMessaging(),
|
||||
subNavs: [
|
||||
{
|
||||
name: 'Customer Information',
|
||||
@@ -63,14 +63,14 @@ const SideMenu = () => {
|
||||
name: 'Calendar',
|
||||
link: '/center-calendar',
|
||||
category: '/center-calendar',
|
||||
roleFunc: () => true
|
||||
roleFunc: AuthService.canViewCalendar
|
||||
},
|
||||
{
|
||||
name: 'Messaging',
|
||||
//collapsed: true,
|
||||
link: '/messages/list',
|
||||
category: '/messages',
|
||||
roleFunc: () => true
|
||||
roleFunc: AuthService.canViewMessaging
|
||||
// subNavs: [
|
||||
// {
|
||||
// name: 'Messages List',
|
||||
@@ -164,37 +164,37 @@ const SideMenu = () => {
|
||||
name: 'Medical',
|
||||
icon: <BagPlus color="#777" size={14}/>,
|
||||
collapsed: false,
|
||||
roleFunc: AuthService.canAccessLegacySystem,
|
||||
roleFunc: AuthService.canViewMedicalSection,
|
||||
subNavs: [
|
||||
{
|
||||
name: 'Provider Information',
|
||||
link: '/medical/resources/list',
|
||||
category: '/resources',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalSection
|
||||
},
|
||||
{
|
||||
name: 'Appointment Requests',
|
||||
link: '/medical/event-request/list',
|
||||
category: '/event-request',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalSection
|
||||
},
|
||||
{
|
||||
name: 'Appointment Calendar',
|
||||
link: '/medical/events/calendar',
|
||||
category: '/events/calendar',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalSection
|
||||
},
|
||||
{
|
||||
name: 'Appointment Multi-Days List',
|
||||
link: '/medical/events/multiple-list',
|
||||
category: '/events/multiple-list',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalSection
|
||||
},
|
||||
{
|
||||
name: 'Template',
|
||||
link: '/medical/template',
|
||||
category: '/medical/template',
|
||||
roleFunc: AuthService.canAccessLegacySystem
|
||||
roleFunc: AuthService.canViewMedicalSection
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -202,17 +202,17 @@ const SideMenu = () => {
|
||||
name: 'Lobby',
|
||||
icon: <Tools color="#777" size={14}/>,
|
||||
collapsed: false,
|
||||
roleFunc: () => true,
|
||||
roleFunc: AuthService.canViewLobby,
|
||||
subNavs: [
|
||||
{
|
||||
name: 'Meal Status',
|
||||
link: '/meal-status',
|
||||
roleFunc: () => true
|
||||
roleFunc: AuthService.canViewMealStatus
|
||||
},
|
||||
{
|
||||
name: 'Seating Chart',
|
||||
link: '/seating',
|
||||
roleFunc: () => true
|
||||
roleFunc: AuthService.canViewSeatingChart
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -46,6 +46,67 @@ const canViewDashboard = () => {
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewInfoScreen = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Info Screen',
|
||||
'Edit_Info Screen'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewCalendar = () => {
|
||||
return hasAnyPermission([
|
||||
'View _Calendar _Medical Appointment',
|
||||
'View _Calendar _Activities',
|
||||
'View _Calendar _Attendance Notes',
|
||||
'View _Calendar _Meal Plan',
|
||||
'View _Calendar _Important Dates',
|
||||
'Edit&Create _Calendar _Medical Appointment',
|
||||
'Edit&Create _Calendar _Activities',
|
||||
'Edit&Create _Calendar _Attendance Notes',
|
||||
'Edit&Create _Calendar _Meal Plan',
|
||||
'Edit&Create _Calendar _Important Dates'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewMessaging = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Messaging',
|
||||
'Sent_Messaging',
|
||||
'View_Messaging Template',
|
||||
'Create&Edit_Messaging Template'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewMedicalSection = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Provider Info',
|
||||
'Create & Edit _Provider Info',
|
||||
'View_Appointment Request',
|
||||
'Edit & Create_Appointment Request',
|
||||
'View_Appointment Calendar',
|
||||
'Edit & Create_Appointment Calendar',
|
||||
'Medical Template'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewMealStatus = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Meal Status',
|
||||
'Edit_Meal Status'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewSeatingChart = () => {
|
||||
return hasAnyPermission([
|
||||
'View_Seating Chart',
|
||||
'Edit_Seating Chart'
|
||||
]);
|
||||
}
|
||||
|
||||
const canViewLobby = () => {
|
||||
return canViewMealStatus() || canViewSeatingChart();
|
||||
}
|
||||
|
||||
const isAdmin = () => {
|
||||
return hasPermission('Set Permission for Employee');
|
||||
}
|
||||
@@ -226,6 +287,13 @@ export const AuthService = {
|
||||
logout,
|
||||
hasPermission,
|
||||
canViewDashboard,
|
||||
canViewInfoScreen,
|
||||
canViewCalendar,
|
||||
canViewMessaging,
|
||||
canViewMedicalSection,
|
||||
canViewMealStatus,
|
||||
canViewSeatingChart,
|
||||
canViewLobby,
|
||||
isAdmin,
|
||||
canCreateOrEditDrivers,
|
||||
getLocalAccessToken,
|
||||
|
||||
Reference in New Issue
Block a user