Skip to content

Commit 48886d6

Browse files
committed
Revert "Allow submission delete for members"
This reverts commit 8d9345b.
1 parent 8d9345b commit 48886d6

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/routes/SubmissionRoutes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = {
5050
controller: 'SubmissionController',
5151
method: 'deleteSubmission',
5252
auth: 'jwt',
53-
access: ['Topcoder User', 'Administrator', 'Copilot'],
53+
access: ['Administrator'],
5454
scopes: ['delete:submission', 'all:submission'],
5555
blockByIp: true
5656
}

test/unit/SubmissionService.test.js

+4-13
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,16 @@ describe('Submission Service tests', () => {
470470
})
471471
})
472472

473-
it('Deleting submission with User token should get succeeded', (done) => {
473+
it('Deleting submission with user token should throw 403', (done) => {
474474
chai.request(app)
475475
.delete(`${config.API_VERSION}/submissions/${testSubmission.Item.id}`)
476476
.set('Authorization', `Bearer ${config.USER_TOKEN}`)
477477
.end((err, res) => {
478-
res.should.have.status(204)
478+
res.should.have.status(403)
479+
res.body.message.should.be.eql('You are not allowed to perform this action!')
479480
done()
480481
})
481-
}).timeout(10000)
482+
})
482483

483484
it('Deleting non-existent submission should throw 404', (done) => {
484485
chai.request(app)
@@ -491,16 +492,6 @@ describe('Submission Service tests', () => {
491492
})
492493
})
493494

494-
it('Deleting submission with Copilot token should get succeeded', (done) => {
495-
chai.request(app)
496-
.delete(`${config.API_VERSION}/submissions/${testSubmission.Item.id}`)
497-
.set('Authorization', `Bearer ${config.COPILOT_TOKEN}`)
498-
.end((err, res) => {
499-
res.should.have.status(204)
500-
done()
501-
})
502-
}).timeout(10000)
503-
504495
it('Deleting submission with Admin token should get succeeded', (done) => {
505496
chai.request(app)
506497
.delete(`${config.API_VERSION}/submissions/${testSubmission.Item.id}`)

0 commit comments

Comments
 (0)