Skip to content

Commit 403ad0d

Browse files
committed
fix: permissions to update/delete invites
1 parent 6d80dd5 commit 403ad0d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/routes/projectMemberInvites/delete.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ 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-
} else if (
45+
}
46+
47+
if (
4648
invite.role !== PROJECT_MEMBER_ROLE.CUSTOMER
4749
&& !ownInvite
4850
&& !util.hasPermission(PERMISSION.DELETE_NON_CUSTOMER_INVITE, req.authUser, req.context.currentProjectMembers)
4951
) {
5052
error = 'You don\'t have permissions to cancel invites to Topcoder Team for other users.';
51-
} else if (
53+
}
54+
55+
if (
5256
invite.role === PROJECT_MEMBER_ROLE.CUSTOMER
5357
&& !ownInvite
5458
&& !util.hasPermission(PERMISSION.DELETE_CUSTOMER_INVITE, req.authUser, req.context.currentProjectMembers)

src/routes/projectMemberInvites/update.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +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-
} else if (
65+
}
66+
67+
if (
6668
!ownInvite
6769
&& !util.hasPermission(PERMISSION.UPDATE_NOT_OWN_INVITE, req.authUser, req.context.currentProjectMembers)
6870
) {

0 commit comments

Comments
 (0)