File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
src/routes/projectMemberInvites Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -42,17 +42,13 @@ module.exports = [
4242 && ! util . hasPermission ( PERMISSION . DELETE_REQUESTED_INVITE , req . authUser , req . context . currentProjectMembers )
4343 ) {
4444 error = 'You don\'t have permissions to cancel requested invites.' ;
45- }
46-
47- if (
45+ } else if (
4846 invite . role !== PROJECT_MEMBER_ROLE . CUSTOMER
4947 && ! ownInvite
5048 && ! util . hasPermission ( PERMISSION . DELETE_NON_CUSTOMER_INVITE , req . authUser , req . context . currentProjectMembers )
5149 ) {
5250 error = 'You don\'t have permissions to cancel invites to Topcoder Team for other users.' ;
53- }
54-
55- if (
51+ } else if (
5652 invite . role === PROJECT_MEMBER_ROLE . CUSTOMER
5753 && ! ownInvite
5854 && ! util . hasPermission ( PERMISSION . DELETE_CUSTOMER_INVITE , req . authUser , req . context . currentProjectMembers )
Original file line number Diff line number Diff line change @@ -62,10 +62,9 @@ module.exports = [
6262 && ! util . hasPermission ( PERMISSION . UPDATE_REQUESTED_INVITE , req . authUser , req . context . currentProjectMembers )
6363 ) {
6464 error = 'You don\'t have permissions to update requested invites.' ;
65- }
66-
67- if (
68- ! ownInvite
65+ } else if (
66+ invite . status !== INVITE_STATUS . REQUESTED
67+ && ! ownInvite
6968 && ! util . hasPermission ( PERMISSION . UPDATE_NOT_OWN_INVITE , req . authUser , req . context . currentProjectMembers )
7069 ) {
7170 error = 'You don\'t have permissions to update invites for other users.' ;
You can’t perform that action at this time.
0 commit comments