Skip to content

Disabled permission check for billingAccountId for project creation as well #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/routes/projects/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ module.exports = [
err.status = 400;
throw err;
}
if (_.has(project, 'billingAccountId') &&
!util.hasPermissionByReq(PERMISSION.MANAGE_PROJECT_BILLING_ACCOUNT_ID, req)) {
const err = new Error('You do not have permission to set \'billingAccountId\' property');
err.status = 400;
throw err;
}
// if (_.has(project, 'billingAccountId') &&
// !util.hasPermissionByReq(PERMISSION.MANAGE_PROJECT_BILLING_ACCOUNT_ID, req)) {
// const err = new Error('You do not have permission to set \'billingAccountId\' property');
// err.status = 400;
// throw err;
// }
// by default connect admin and managers joins projects as manager
const userRole = util.hasPermissionByReq(PERMISSION.CREATE_PROJECT_AS_MANAGER, req)
? PROJECT_MEMBER_ROLE.MANAGER
Expand Down
4 changes: 2 additions & 2 deletions src/routes/projects/create.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ describe('Project create', () => {
.expect(400, done);
});

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

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