@@ -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