Skip to content

Commit 458539a

Browse files
authored
Merge pull request #740 from topcoder-platform/develop
Observer role addition
2 parents e716cfc + af186c2 commit 458539a

File tree

7 files changed

+58
-509
lines changed

7 files changed

+58
-509
lines changed

.circleci/config.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
version: 2
1+
version: 2.1
22
python_env: &python_env
33
docker:
4-
- image: circleci/python:2.7-stretch-browsers
5-
4+
- image: cimg/python:3.11.0-browsers
65
install_awscli: &install_awscli
76
name: "Install awscli"
87
command: |
9-
sudo pip install awscli --upgrade
8+
sudo apt update
9+
sudo apt install jq
10+
sudo apt install python3-pip
11+
sudo pip3 install awscli --upgrade
1012
install_deploysuite: &install_deploysuite
1113
name: Installation of install_deploysuite.
1214
command: |
13-
git clone --branch v1.4.1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
15+
git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
1416
cp ./../buildscript/master_deploy.sh .
1517
cp ./../buildscript/buildenv.sh .
1618
cp ./../buildscript/awsconfiguration.sh .

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<version>${jmeter-maven-plugin.version}</version>
4848
<configuration>
4949
<generateReports>true</generateReports>
50-
<errorRateThresholdInPercent>60</errorRateThresholdInPercent>
50+
<errorRateThresholdInPercent>61</errorRateThresholdInPercent>
5151
<testResultsTimestamp>false</testResultsTimestamp>
5252
<propertiesJMeter>
5353
<BUILD_TAG>${project.version}</BUILD_TAG>

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export const PROJECT_MEMBER_ROLE = {
3434

3535
export const PROJECT_MEMBER_MANAGER_ROLES = [
3636
PROJECT_MEMBER_ROLE.MANAGER,
37-
PROJECT_MEMBER_ROLE.OBSERVER,
3837
PROJECT_MEMBER_ROLE.ACCOUNT_MANAGER,
3938
PROJECT_MEMBER_ROLE.ACCOUNT_EXECUTIVE,
4039
PROJECT_MEMBER_ROLE.PROJECT_MANAGER,
@@ -142,6 +141,7 @@ export const BUS_API_EVENT = {
142141
PROJECT_CREATED: 'project.action.create',
143142
PROJECT_UPDATED: 'project.action.update',
144143
PROJECT_DELETED: 'project.action.delete',
144+
PROJECT_BILLING_ACCOUNT_UPDATED: 'project.action.billingAccount.update',
145145

146146
PROJECT_MEMBER_ADDED: 'project.action.create',
147147
PROJECT_MEMBER_REMOVED: 'project.action.delete',

src/events/busApi.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ module.exports = (app, logger) => {
9696
projectUrl: connectProjectUrl(updated.id),
9797
}), logger);
9898

99+
if (!_.isEqual(original.billingAccountId, updated.billingAccountId)) {
100+
logger.debug('project billing account is updated');
101+
createEvent(BUS_API_EVENT.PROJECT_BILLING_ACCOUNT_UPDATED, {
102+
projectId: updated.id,
103+
projectName: updated.name,
104+
directProjectId: updated.directProjectId,
105+
status: updated.status,
106+
oldBillingAccountId: original.billingAccountId,
107+
newBillingAccountId: updated.billingAccountId,
108+
}, logger);
109+
}
110+
99111
/*
100112
Send event for Notification Service
101113
*/

src/permissions/constants.js

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
216216
description: 'There are additional limitations on editing some parts of the project.',
217217
},
218218
topcoderRoles: TOPCODER_ROLES_MANAGERS_AND_ADMINS,
219-
projectRoles: ALL,
219+
projectRoles: [
220+
...PROJECT_ROLES_MANAGEMENT,
221+
PROJECT_MEMBER_ROLE.COPILOT,
222+
],
220223
scopes: SCOPES_PROJECTS_WRITE,
221224
},
222225

@@ -365,7 +368,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
365368
description: 'Who can update project members with "customer" role.',
366369
},
367370
topcoderRoles: TOPCODER_ROLES_ADMINS,
368-
projectRoles: ALL,
371+
projectRoles: [
372+
...PROJECT_ROLES_MANAGEMENT,
373+
PROJECT_MEMBER_ROLE.COPILOT,
374+
],
369375
scopes: SCOPES_PROJECT_MEMBERS_WRITE,
370376
},
371377

@@ -387,7 +393,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
387393
description: 'Who can delete project members with "customer" role.',
388394
},
389395
topcoderRoles: TOPCODER_ROLES_ADMINS,
390-
projectRoles: ALL,
396+
projectRoles: [
397+
...PROJECT_ROLES_MANAGEMENT,
398+
PROJECT_MEMBER_ROLE.COPILOT,
399+
],
391400
scopes: SCOPES_PROJECT_MEMBERS_WRITE,
392401
},
393402

@@ -412,7 +421,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
412421
...TOPCODER_ROLES_ADMINS,
413422
USER_ROLE.COPILOT_MANAGER,
414423
],
415-
projectRoles: ALL,
424+
projectRoles: [
425+
...PROJECT_ROLES_MANAGEMENT,
426+
PROJECT_MEMBER_ROLE.COPILOT,
427+
],
416428
scopes: SCOPES_PROJECT_MEMBERS_WRITE,
417429
},
418430

@@ -436,7 +448,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
436448
description: 'Who can view invites of other users.',
437449
},
438450
topcoderRoles: TOPCODER_ROLES_MANAGERS_AND_ADMINS,
439-
projectRoles: ALL,
451+
projectRoles: [
452+
...PROJECT_ROLES_MANAGEMENT,
453+
PROJECT_MEMBER_ROLE.COPILOT,
454+
],
440455
scopes: SCOPES_PROJECT_INVITES_READ,
441456
},
442457

@@ -447,7 +462,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
447462
description: 'Who can invite project members with "customer" role.',
448463
},
449464
topcoderRoles: TOPCODER_ROLES_ADMINS,
450-
projectRoles: ALL,
465+
projectRoles: [
466+
...PROJECT_ROLES_MANAGEMENT,
467+
PROJECT_MEMBER_ROLE.COPILOT,
468+
],
451469
scopes: SCOPES_PROJECT_INVITES_WRITE,
452470
},
453471

@@ -576,7 +594,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
576594
group: 'Project Attachment',
577595
},
578596
topcoderRoles: TOPCODER_ROLES_MANAGERS_AND_ADMINS,
579-
projectRoles: ALL,
597+
projectRoles: [
598+
...PROJECT_ROLES_MANAGEMENT,
599+
PROJECT_MEMBER_ROLE.COPILOT,
600+
],
580601
scopes: SCOPES_PROJECTS_WRITE,
581602
},
582603

@@ -608,7 +629,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
608629
description: 'Who can edit attachment they created.',
609630
},
610631
topcoderRoles: TOPCODER_ROLES_MANAGERS_AND_ADMINS,
611-
projectRoles: ALL,
632+
projectRoles: [
633+
...PROJECT_ROLES_MANAGEMENT,
634+
PROJECT_MEMBER_ROLE.COPILOT,
635+
],
612636
scopes: SCOPES_PROJECTS_WRITE,
613637
},
614638

@@ -629,7 +653,10 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
629653
description: 'Who can delete attachment they created.',
630654
},
631655
topcoderRoles: TOPCODER_ROLES_MANAGERS_AND_ADMINS,
632-
projectRoles: ALL,
656+
projectRoles: [
657+
...PROJECT_ROLES_MANAGEMENT,
658+
PROJECT_MEMBER_ROLE.COPILOT,
659+
],
633660
scopes: SCOPES_PROJECTS_WRITE,
634661
},
635662

@@ -708,6 +735,7 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
708735
*/
709736
export const PROJECT_TO_TOPCODER_ROLES_MATRIX = {
710737
[PROJECT_MEMBER_ROLE.CUSTOMER]: _.values(USER_ROLE),
738+
[PROJECT_MEMBER_ROLE.OBSERVER]: _.values(USER_ROLE),
711739
[PROJECT_MEMBER_ROLE.MANAGER]: [
712740
USER_ROLE.TOPCODER_ADMIN,
713741
USER_ROLE.CONNECT_ADMIN,

0 commit comments

Comments
 (0)