Skip to content

PM-4973: Restrict project user management actions#1789

Merged
jmgasper merged 1 commit into
devfrom
PM-4973
May 1, 2026
Merged

PM-4973: Restrict project user management actions#1789
jmgasper merged 1 commit into
devfrom
PM-4973

Conversation

@jmgasper
Copy link
Copy Markdown
Collaborator

@jmgasper jmgasper commented Apr 29, 2026

What was broken

Work Manager users with global Copilot, Project Manager, or Talent Manager access could open a project users URL directly and still get member-management controls for a project they could not manage.

Root cause (if identifiable)

The users page enabled add, invite, remove, and role-edit controls from global Work Manager role flags instead of requiring manage access to the loaded project.

What was changed

The users page now derives member-management permission from the existing project management access helper for the loaded project. The same permission guards the header actions, editable member cards, and add/invite modal rendering.

Any added/updated tests

Added a UsersManagementPage regression test that verifies a global Project Manager who cannot manage the loaded project does not see add, invite, or edit controls.

Validation:

  • yarn test:no-watch --runTestsByPath src/apps/work/src/pages/users/UsersManagementPage/UsersManagementPage.spec.tsx passed.
  • yarn lint passed.
  • yarn run build passed with existing warnings.
  • yarn test:no-watch still fails in src/apps/wallet-admin/src/lib/components/payment-view/PaymentView.spec.tsx, and that spec also fails when run by itself. The failure expects a challenge URL but receives a project URL, outside the PM-4973 users-page change.

Open in Devin Review

What was broken

Work Manager users with global Copilot, Project Manager, or Talent Manager access could open a project users URL directly and still get member-management controls for a project they could not manage.

Root cause (if identifiable)

The users page enabled add, invite, remove, and role-edit controls from global Work Manager role flags instead of requiring manage access to the loaded project.

What was changed

The users page now derives member-management permission from the existing project management access helper for the loaded project. The same permission guards the header actions, editable member cards, and add/invite modal rendering.

Any added/updated tests

Added a UsersManagementPage regression test that verifies a global Project Manager who cannot manage the loaded project does not see add, invite, or edit controls.

Validation note

The focused UsersManagementPage test, lint, and build pass. The full test command still fails in an unrelated wallet-admin PaymentView spec that also fails when run by itself.
@jmgasper jmgasper marked this pull request as ready for review May 1, 2026 00:19
@jmgasper jmgasper requested a review from kkartunov as a code owner May 1, 2026 00:19
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@jmgasper jmgasper merged commit be475d4 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.

1 participant