Skip to content

PM-4393: Guard project workspace routes#1790

Merged
jmgasper merged 2 commits into
devfrom
PM-4393-3
May 1, 2026
Merged

PM-4393: Guard project workspace routes#1790
jmgasper merged 2 commits into
devfrom
PM-4393-3

Conversation

@jmgasper

@jmgasper jmgasper commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

What was broken
The previous PM-4393 fixes blocked unauthorized project challenge list and challenge detail URLs, but other project workspace URLs still mounted for users who were not members of the project. QA found TM, PM, and copilot users could open project engagement, engagement detail, users, and asset library URLs and in some cases add project members.

Root cause
The existing project access check was applied inside challenge pages only. Project-scoped route entries for engagements, users, and assets rendered their child pages before confirming project membership, allowing those pages to fetch and display child project data.

What was changed
Added a reusable ProjectRouteAccessGuard that checks the current route project with checkProjectAccess before rendering protected route content. Wrapped the project engagement list/detail/application/assignment/feedback/experience routes, project users route, and project asset library route so unauthorized users see the required project access message.

Any added/updated tests
Added ProjectRouteAccessGuard tests covering allowed access, loading, denied membership, and failed project fetches.

Validation run:

  • yarn test:no-watch src/apps/work/src/lib/components/ProjectRouteAccessGuard/ProjectRouteAccessGuard.spec.tsx src/apps/work/src/pages/engagements/EngagementsListPage/EngagementsListPage.spec.tsx src/apps/work/src/pages/users/UsersManagementPage/UsersManagementPage.spec.tsx src/apps/work/src/pages/assets/ProjectAssetsPage/ProjectAssetsPage.spec.tsx
  • yarn lint
  • yarn run build
  • yarn test:no-watch --silent

Focused Work tests, lint, and build passed. The full yarn test:no-watch --silent suite still fails in unrelated wallet-admin PaymentView coverage expecting a challenge URL while receiving a project URL.


Open in Devin Review

What was broken
The previous PM-4393 fixes blocked unauthorized project challenge list and challenge detail URLs, but other project workspace URLs still mounted for users who were not members of the project. QA found TM, PM, and copilot users could open project engagement, engagement detail, users, and asset library URLs and in some cases add project members.

Root cause
The existing project access check was applied inside challenge pages only. Project-scoped route entries for engagements, users, and assets rendered their child pages before confirming project membership, allowing those pages to fetch and display child project data.

What was changed
Added a reusable ProjectRouteAccessGuard that checks the current route project with checkProjectAccess before rendering protected route content. Wrapped the project engagement list/detail/application/assignment/feedback/experience routes, project users route, and project asset library route so unauthorized users see the required project access message.

Any added/updated tests
Added ProjectRouteAccessGuard tests covering allowed access, loading, denied membership, and failed project fetches.
@jmgasper jmgasper requested a review from kkartunov as a code owner April 29, 2026 08:34
devin-ai-integration[bot]

This comment was marked as resolved.

@jmgasper jmgasper merged commit 920b95a into dev May 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants