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 = [
42
42
&& ! util . hasPermission ( PERMISSION . DELETE_REQUESTED_INVITE , req . authUser , req . context . currentProjectMembers )
43
43
) {
44
44
error = 'You don\'t have permissions to cancel requested invites.' ;
45
- }
46
-
47
- if (
45
+ } else if (
48
46
invite . role !== PROJECT_MEMBER_ROLE . CUSTOMER
49
47
&& ! ownInvite
50
48
&& ! util . hasPermission ( PERMISSION . DELETE_NON_CUSTOMER_INVITE , req . authUser , req . context . currentProjectMembers )
51
49
) {
52
50
error = 'You don\'t have permissions to cancel invites to Topcoder Team for other users.' ;
53
- }
54
-
55
- if (
51
+ } else if (
56
52
invite . role === PROJECT_MEMBER_ROLE . CUSTOMER
57
53
&& ! ownInvite
58
54
&& ! 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 = [
62
62
&& ! util . hasPermission ( PERMISSION . UPDATE_REQUESTED_INVITE , req . authUser , req . context . currentProjectMembers )
63
63
) {
64
64
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
69
68
&& ! util . hasPermission ( PERMISSION . UPDATE_NOT_OWN_INVITE , req . authUser , req . context . currentProjectMembers )
70
69
) {
71
70
error = 'You don\'t have permissions to update invites for other users.' ;
You can’t perform that action at this time.
0 commit comments