Skip to content

Commit 4022be1

Browse files
author
vikasrohit
authored
Merge pull request #578 from topcoder-platform/hotfix/separate_role_for_billing_account_write_access
Disabled permission check for billingAccountId for project creation as well
2 parents 2486d4a + e437c6a commit 4022be1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/routes/projects/create.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,12 @@ module.exports = [
393393
err.status = 400;
394394
throw err;
395395
}
396-
if (_.has(project, 'billingAccountId') &&
397-
!util.hasPermissionByReq(PERMISSION.MANAGE_PROJECT_BILLING_ACCOUNT_ID, req)) {
398-
const err = new Error('You do not have permission to set \'billingAccountId\' property');
399-
err.status = 400;
400-
throw err;
401-
}
396+
// if (_.has(project, 'billingAccountId') &&
397+
// !util.hasPermissionByReq(PERMISSION.MANAGE_PROJECT_BILLING_ACCOUNT_ID, req)) {
398+
// const err = new Error('You do not have permission to set \'billingAccountId\' property');
399+
// err.status = 400;
400+
// throw err;
401+
// }
402402
// by default connect admin and managers joins projects as manager
403403
const userRole = util.hasPermissionByReq(PERMISSION.CREATE_PROJECT_AS_MANAGER, req)
404404
? PROJECT_MEMBER_ROLE.MANAGER

src/routes/projects/create.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe('Project create', () => {
397397
.expect(400, done);
398398
});
399399

400-
it(`should return 400 when creating project with billingAccountId
400+
xit(`should return 400 when creating project with billingAccountId
401401
without "write:projects-billing-accounts" scope in M2M token`, (done) => {
402402
const validBody = _.cloneDeep(body);
403403
validBody.billingAccountId = 1;
@@ -411,7 +411,7 @@ describe('Project create', () => {
411411
.expect(400, done);
412412
});
413413

414-
it(`should return 400 when creating project with directProjectId
414+
xit(`should return 400 when creating project with directProjectId
415415
without "write:projects" scope in M2M token`, (done) => {
416416
const validBody = _.cloneDeep(body);
417417
validBody.directProjectId = 1;

0 commit comments

Comments
 (0)