Skip to content

Commit 56f6113

Browse files
author
vikasrohit
authored
Merge pull request #16 from topcoder-platform/develop
Prod Deploy - Fixing the permission issue with Copilot addition
2 parents 135e253 + d7aa00b commit 56f6113

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/services/ProcessorService.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,9 @@ async function addCopilot (userId, projectId, currentUser) {
618618
// get direct project id from projects api
619619
const directProjectId = await getDirectProjectId(connection, projectId)
620620

621+
// NOTE: we don't check permission this way, see why https://github.com/topcoder-platform/tc-project-service/issues/524#issuecomment-616541539
621622
// Check the current user permission on the project
622-
await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
623+
// await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
623624

624625
// check if member is assigned as copilot
625626
const isProjectCopilot = await checkIsProjectCopilot(connection, directProjectId, copilotProfileId)
@@ -769,8 +770,9 @@ async function addManager (userId, projectId, isManager, currentUser) {
769770
// get direct project id from projects api
770771
const directProjectId = await getDirectProjectId(connection, projectId)
771772

773+
// NOTE: we don't check permission this way, see why https://github.com/topcoder-platform/tc-project-service/issues/524#issuecomment-616541539
772774
// Check the current user permission on the project
773-
await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
775+
// await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
774776

775777
const users = await getAllManagers(connection, directProjectId, metadataKeyId)
776778

@@ -846,8 +848,9 @@ async function removeCopilot (userId, projectId, currentUser) {
846848
// get direct project id from projects api
847849
const directProjectId = await getDirectProjectId(connection, projectId)
848850

851+
// NOTE: we don't check permission this way, see why https://github.com/topcoder-platform/tc-project-service/issues/524#issuecomment-616541539
849852
// Check the current user permission on the project
850-
await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
853+
// await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
851854

852855
// check if member is assigned as copilot
853856
const isProjectCopilot = await checkIsProjectCopilot(connection, directProjectId, copilotProfileId)
@@ -937,8 +940,9 @@ async function removeManager (userId, projectId, isManager, currentUser) {
937940
// get direct project id from projects api
938941
const directProjectId = await getDirectProjectId(connection, projectId)
939942

943+
// NOTE: we don't check permission this way, see why https://github.com/topcoder-platform/tc-project-service/issues/524#issuecomment-616541539
940944
// Check the current user permission on the project
941-
await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
945+
// await checkAndGetPermissionId(connection, directProjectId, currentUser, PERMISSION_TYPE.PROJECT_FULL)
942946

943947
const users = await getAllManagers(connection, directProjectId, metadataKeyId)
944948

0 commit comments

Comments
 (0)