Skip to content

Commit 476a710

Browse files
Merge pull request #264 from topcoder-platform/develop
one more fix
2 parents 8d51526 + 8de93fb commit 476a710

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/ChallengeService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ async function getChallenge (currentUser, id) {
923923

924924
// Check if challenge is task and apply security rules
925925
if (_.get(challenge, 'task.isTask', false) && _.get(challenge, 'task.isAssigned', false)) {
926-
if (!currentUser || !(currentUser.isMachine || helper.hasAdminRole(currentUser)) || _.toString(currentUser.userId) !== _.toString(_.get(challenge, 'task.memberId'))) {
926+
if (!currentUser || (!currentUser.isMachine && !helper.hasAdminRole(currentUser) && _.toString(currentUser.userId) !== _.toString(_.get(challenge, 'task.memberId')))) {
927927
throw new errors.ForbiddenError(`You don't have access to view this challenge`)
928928
}
929929
}

0 commit comments

Comments
 (0)