Skip to content

Commit 83f2a9d

Browse files
Merge pull request topcoder-platform#80 from sharathkumaranbu/Issue_4
Remove role check for M2M tokens
2 parents 69e4fe7 + 41c9e87 commit 83f2a9d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/services/SubmissionService.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ function * getSubmission (authUser, submissionId) {
8989
throw new errors.HttpStatusError(404, `Submission with ID = ${submissionId} is not found`)
9090
}
9191

92-
// logger.info('Check User access before returning the submission')
93-
// if (_.intersection(authUser.roles, ['Administrator']).length === 0) {
94-
// yield helper.checkGetAccess(authUser, submissionRecord)
95-
// }
92+
logger.info('Check User access before returning the submission')
93+
if (_.intersection(authUser.roles, ['Administrator']).length === 0 && !authUser.scopes) {
94+
yield helper.checkGetAccess(authUser, submissionRecord)
95+
}
9696

9797
// Return the retrieved submission
9898
logger.info(`getSubmission: returning data for submissionId: ${submissionId}`)
@@ -205,7 +205,7 @@ function * createSubmission (authUser, files, entity) {
205205
}
206206

207207
logger.info('Check User access before creating the submission')
208-
if (_.intersection(authUser.roles, ['Administrator']).length === 0) {
208+
if (_.intersection(authUser.roles, ['Administrator']).length === 0 && !authUser.scopes) {
209209
yield helper.checkCreateAccess(authUser, item)
210210
}
211211

0 commit comments

Comments
 (0)