mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 02:32:29 +00:00
In admin settings, this Pr will add the UI for managing custom roles ( ref: https://github.com/chatwoot/chatwoot/pull/9995 ). It also handles the routing logic changes to accommodate fine-tuned permissions. --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: iamsivin <iamsivin@gmail.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
export const AVAILABLE_CUSTOM_ROLE_PERMISSIONS = [
|
|
'conversation_manage',
|
|
'conversation_unassigned_manage',
|
|
'conversation_participating_manage',
|
|
'contact_manage',
|
|
'report_manage',
|
|
'knowledge_base_manage',
|
|
];
|
|
|
|
export const ROLES = ['agent', 'administrator'];
|
|
|
|
export const CONVERSATION_PERMISSIONS = [
|
|
'conversation_manage',
|
|
'conversation_unassigned_manage',
|
|
'conversation_participating_manage',
|
|
];
|
|
|
|
export const MANAGE_ALL_CONVERSATION_PERMISSIONS = 'conversation_manage';
|
|
|
|
export const CONVERSATION_UNASSIGNED_PERMISSIONS =
|
|
'conversation_unassigned_manage';
|
|
|
|
export const CONVERSATION_PARTICIPATING_PERMISSIONS =
|
|
'conversation_participating_manage';
|
|
|
|
export const CONTACT_PERMISSIONS = 'contact_manage';
|
|
|
|
export const REPORTS_PERMISSIONS = 'report_manage';
|
|
|
|
export const PORTAL_PERMISSIONS = 'knowledge_base_manage';
|
|
|
|
export const ASSIGNEE_TYPE_TAB_PERMISSIONS = {
|
|
me: {
|
|
count: 'mineCount',
|
|
permissions: [...ROLES, ...CONVERSATION_PERMISSIONS],
|
|
},
|
|
unassigned: {
|
|
count: 'unAssignedCount',
|
|
permissions: [
|
|
...ROLES,
|
|
MANAGE_ALL_CONVERSATION_PERMISSIONS,
|
|
CONVERSATION_UNASSIGNED_PERMISSIONS,
|
|
],
|
|
},
|
|
all: {
|
|
count: 'allCount',
|
|
permissions: [
|
|
...ROLES,
|
|
MANAGE_ALL_CONVERSATION_PERMISSIONS,
|
|
CONVERSATION_PARTICIPATING_PERMISSIONS,
|
|
],
|
|
},
|
|
};
|