Skip to content

Commit c81edf1

Browse files
authored
Merge pull request #359 from topcoder-platform/develop
Add 'tgadmin' to administrator auth checks for Topgear
2 parents f1c1555 + 5cd6314 commit c81edf1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/services/ReviewService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async function createReview (authUser, entity) {
165165
entity
166166
)
167167

168-
if (_.intersection(authUser.roles, ['Administrator', 'administrator']).length === 0 && !authUser.scopes) {
168+
if (_.intersection(authUser.roles, ['Administrator', 'administrator', 'tgadmin']).length === 0 && !authUser.scopes) {
169169
if (entity.reviewedDate) {
170170
throw new errors.HttpStatusError(403, 'You are not allowed to set the `reviewedDate` attribute on a review')
171171
}

src/services/ReviewSummationService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async function createReviewSummation (authUser, entity) {
102102
item.isFinal = entity.isFinal
103103
}
104104

105-
if (_.intersection(authUser.roles, ['Administrator', 'administrator']).length === 0 && !authUser.scopes) {
105+
if (_.intersection(authUser.roles, ['Administrator', 'administrator', 'tgadmin']).length === 0 && !authUser.scopes) {
106106
if (entity.reviewedDate) {
107107
throw new errors.HttpStatusError(403, 'You are not allowed to set the `reviewedDate` attribute on a review summation')
108108
}

src/services/SubmissionService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ async function createSubmission (authUser, files, entity) {
403403
}
404404

405405
logger.info('Check User access before creating the submission')
406-
if (_.intersection(authUser.roles, ['Administrator', 'administrator']).length === 0 && !authUser.scopes) {
406+
if (_.intersection(authUser.roles, ['Administrator', 'administrator', 'tgadmin']).length === 0 && !authUser.scopes) {
407407
await helper.checkCreateAccess(authUser, item.memberId, challenge)
408408

409409
if (entity.submittedDate) {

0 commit comments

Comments
 (0)