diff --git a/src/routes/projectMemberInvites/create.js b/src/routes/projectMemberInvites/create.js index 7717bdc9..3214c493 100644 --- a/src/routes/projectMemberInvites/create.js +++ b/src/routes/projectMemberInvites/create.js @@ -181,7 +181,7 @@ module.exports = [ // permission: // user has to have constants.MANAGER_ROLES role // to be invited as PROJECT_MEMBER_ROLE.MANAGER - if (invite.role === PROJECT_MEMBER_ROLE.MANAGER) { + if (_.includes(PROJECT_MEMBER_MANAGER_ROLES, invite.role)) { _.forEach(invite.userIds, (userId) => { req.log.info(userId); promises.push(util.getUserRoles(userId, req.log, req.id)); @@ -207,6 +207,7 @@ module.exports = [ const forbidUserList = []; _.zip(invite.userIds, rolesList).forEach((data) => { const [userId, roles] = data; + req.log.debug(roles); if (!util.hasIntersection(MANAGER_ROLES, roles)) { forbidUserList.push(userId);