diff --git a/src/service/programService.js b/src/service/programService.js index ea818923ab580d030bb630994cb9b464f662310f..f7ab7b5df974cc78c13a8e2099a91e29da688c45 100644 --- a/src/service/programService.js +++ b/src/service/programService.js @@ -2652,12 +2652,14 @@ function publishContent(req, response){ function getUserOrganisationRoles(profileData, rootorg_id) { let userRoles = ['PUBLIC']; - if (profileData.organisations) { - let thisOrg = _.find(profileData.organisations, { - organisationId: rootorg_id - }); - userRoles = _.union(userRoles, thisOrg.roles); - } + userRoles = _.uniq(_.union(userRoles, _.map(profileData.roles, 'role'))); + // if (profileData.organisations) { + // let thisOrg = _.find(profileData.organisations, { + // organisationId: rootorg_id + // }); + // userRoles = _.union(userRoles, thisOrg.roles); + // } + return userRoles; }