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 @@ -653,6 +653,7 @@ _.assignIn(util, {
653
653
654
654
const isAdmin = util . hasPermission ( { topcoderRoles : [ USER_ROLE . TOPCODER_ADMIN ] } , req . authUser ) ;
655
655
const currentUserId = req . authUser . userId ;
656
+ const currentUserEmail = req . authUser . email ;
656
657
657
658
// admins can get data as it is
658
659
if ( isAdmin ) {
@@ -669,7 +670,13 @@ _.assignIn(util, {
669
670
const canSeeEmail = (
670
671
isAdmin || // admin
671
672
invite . createdBy === currentUserId || // user who created invite
672
- invite . userId === currentUserId // user who is invited
673
+ ( invite . userId !== null && invite . userId === currentUserId ) || // user who is invited by `handle`
674
+ ( // user who is invited by `email` (invite doesn't have `userId`)
675
+ invite . userId === null &&
676
+ invite . email &&
677
+ currentUserEmail &&
678
+ invite . email . toLowerCase ( ) === currentUserEmail . toLowerCase ( )
679
+ )
673
680
) ;
674
681
// mask email if user cannot see it
675
682
_ . assign ( invite , {
You can’t perform that action at this time.
0 commit comments