Publish current project state
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { CONVERSATION_PRIORITY_ORDER } from 'shared/constants/messages';
|
||||
import {
|
||||
ROLE_AGENT,
|
||||
ROLE_ADMINISTRATOR,
|
||||
} from 'dashboard/constants/permissions.js';
|
||||
|
||||
export const findPendingMessageIndex = (chat, message) => {
|
||||
const { echo_id: tempMessageId } = message;
|
||||
@@ -79,9 +83,9 @@ export const applyRoleFilter = (
|
||||
) => {
|
||||
// the role === "agent" check is typically not correct on it's own
|
||||
// the backend handles this by checking the custom_role_id at the user model
|
||||
// here however, the `getUserRole` returns "custom_role" if the id is present,
|
||||
// here however, `getUserRole` returns the custom-role constant if the id is present,
|
||||
// so we can check the role === "agent" directly
|
||||
if (['administrator', 'agent'].includes(role)) {
|
||||
if ([ROLE_ADMINISTRATOR, ROLE_AGENT].includes(role)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user