@@ -9,7 +9,11 @@ import {
99 ROLE_CONNECT_COPILOT ,
1010 ROLE_TOPCODER_USER ,
1111 ROLE_CONNECT_MANAGER ,
12- ROLE_CONNECT_ADMIN
12+ ROLE_CONNECT_ADMIN ,
13+ ROLE_ACCOUNT_EXECUTIVE ,
14+ ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE ,
15+ ROLE_PROGRAM_MANAGER ,
16+ ROLE_PRESALES , ROLE_PROJECT_MANAGER , ROLE_SOLUTION_ARCHITECT
1317} from '../config/constants'
1418import { getFreshToken , configureConnector , decodeToken } from 'tc-accounts'
1519import { getUserProfile } from '../api/users'
@@ -55,7 +59,19 @@ export function loadUserSuccess(dispatch, token) {
5559 currentUser = _ . assign ( currentUser , profile )
5660 // determine user role
5761 let userRole
58- if ( _ . indexOf ( currentUser . roles , ROLE_ADMINISTRATOR ) > - 1 ) {
62+ if ( _ . indexOf ( currentUser . roles , ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE ) > - 1 ) {
63+ userRole = ROLE_BUSINESS_DEVELOPMENT_REPRESENTATIVE
64+ } else if ( _ . indexOf ( currentUser . roles , ROLE_PRESALES ) > - 1 ) {
65+ userRole = ROLE_PRESALES
66+ } else if ( _ . indexOf ( currentUser . roles , ROLE_ACCOUNT_EXECUTIVE ) > - 1 ) {
67+ userRole = ROLE_ACCOUNT_EXECUTIVE
68+ } else if ( _ . indexOf ( currentUser . roles , ROLE_PROGRAM_MANAGER ) > - 1 ) {
69+ userRole = ROLE_PROGRAM_MANAGER
70+ } else if ( _ . indexOf ( currentUser . roles , ROLE_PROJECT_MANAGER ) > - 1 ) {
71+ userRole = ROLE_PROJECT_MANAGER
72+ } else if ( _ . indexOf ( currentUser . roles , ROLE_SOLUTION_ARCHITECT ) > - 1 ) {
73+ userRole = ROLE_SOLUTION_ARCHITECT
74+ } else if ( _ . indexOf ( currentUser . roles , ROLE_ADMINISTRATOR ) > - 1 ) {
5975 userRole = ROLE_ADMINISTRATOR
6076 } else if ( _ . indexOf ( currentUser . roles , ROLE_CONNECT_ADMIN ) > - 1 ) {
6177 userRole = ROLE_CONNECT_ADMIN
0 commit comments