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, {
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 , {
You can’t perform that action at this time.
0 commit comments