Skip to content

Commit 344671c

Browse files
committed
fix: send project info only for PM and admin role users
1 parent def3f5c commit 344671c

File tree

1 file changed

+5
-0
lines changed
  • src/routes/copilotOpportunity

1 file changed

+5
-0
lines changed

src/routes/copilotOpportunity/list.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ module.exports = [
6666
.then((copilotOpportunities) => {
6767
const formattedOpportunities = copilotOpportunities.map((opportunity) => {
6868
const plainOpportunity = opportunity.get({ plain: true });
69+
// For users who are not admin or manager, we dont want to expose
70+
// the project id
71+
if (!isAdminOrManager) {
72+
delete plainOpportunity.projectId;
73+
}
6974
return Object.assign({}, plainOpportunity,
7075
plainOpportunity.copilotRequest ? plainOpportunity.copilotRequest.data : {},
7176
{ copilotRequest: undefined },

0 commit comments

Comments
 (0)