Skip to content

Commit 98d2fde

Browse files
authored
Merge pull request #549 from topcoder-platform/hotfix/post-release-2.3.1
[HOTFIX] [DEV] Post release 2.3.1
2 parents f50e54f + 64efe2a commit 98d2fde

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/util.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ _.assignIn(util, {
652652

653653
const isAdmin = util.hasPermission({ topcoderRoles: [USER_ROLE.TOPCODER_ADMIN] }, req.authUser);
654654
const currentUserId = req.authUser.userId;
655+
const currentUserEmail = req.authUser.email;
655656

656657
// admins can get data as it is
657658
if (isAdmin) {
@@ -668,7 +669,13 @@ _.assignIn(util, {
668669
const canSeeEmail = (
669670
isAdmin || // admin
670671
invite.createdBy === currentUserId || // user who created invite
671-
invite.userId === currentUserId // user who is invited
672+
(invite.userId !== null && invite.userId === currentUserId) || // user who is invited by `handle`
673+
( // user who is invited by `email` (invite doesn't have `userId`)
674+
invite.userId === null &&
675+
invite.email &&
676+
currentUserEmail &&
677+
invite.email.toLowerCase() === currentUserEmail.toLowerCase()
678+
)
672679
);
673680
// mask email if user cannot see it
674681
_.assign(invite, {

0 commit comments

Comments
 (0)