File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,7 @@ _.assignIn(util, {
652
652
653
653
const isAdmin = util . hasPermission ( { topcoderRoles : [ USER_ROLE . TOPCODER_ADMIN ] } , req . authUser ) ;
654
654
const currentUserId = req . authUser . userId ;
655
+ const currentUserEmail = req . authUser . email ;
655
656
656
657
// admins can get data as it is
657
658
if ( isAdmin ) {
@@ -668,7 +669,13 @@ _.assignIn(util, {
668
669
const canSeeEmail = (
669
670
isAdmin || // admin
670
671
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
+ )
672
679
) ;
673
680
// mask email if user cannot see it
674
681
_ . assign ( invite , {
You can’t perform that action at this time.
0 commit comments