Conversation
What was broken The previous PM-3764 fix restored legacy read parity inside PermissionService, but some QA users could still be denied before those permission checks ran. Tokens carrying the legacy `topcoder_manager` role were excluded from controller-level `@Roles(...Object.values(UserRole))` allowlists, so the read-parity logic never executed for them. Root cause (if identifiable) PermissionService and the Swagger permission documentation still knew about the legacy `topcoder_manager` role, but the shared UserRole enum did not. Route-level role gates derive their allowlists from `Object.values(UserRole)`, which left the coarse auth layer out of sync with the PM-3764 compatibility logic. What was changed Added `UserRole.TOPCODER_MANAGER` for the legacy JWT role and updated the permission/documentation helpers to use the enum-backed value. Kept the existing PM-3764 read-parity behavior intact while extending regression coverage for legacy `topcoder_manager` access through the route guard and read-permission paths. Documented that `topcoder_manager` is accepted by both route guards and PermissionService. Any added/updated tests Added a TokenRolesGuard regression test covering `topcoder_manager` against `Object.values(UserRole)` route allowlists. Expanded PermissionService regression coverage for `topcoder_manager` project, member, invite, and attachment read access. Validated with `pnpm lint`, targeted auth regression tests, and `pnpm build`. The full `pnpm test` suite still has the existing unrelated metadata event-bus failures on the current `dev` baseline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The previous PM-3764 fix restored legacy read parity inside PermissionService, but some QA users could still be denied before those permission checks ran. Tokens carrying the legacy
topcoder_managerrole were excluded from controller-level@Roles(...Object.values(UserRole))allowlists, so the read-parity logic never executed for them.Root cause (if identifiable)
PermissionService and the Swagger permission documentation still knew about the legacy
topcoder_managerrole, but the shared UserRole enum did not. Route-level role gates derive their allowlists fromObject.values(UserRole), which left the coarse auth layer out of sync with the PM-3764 compatibility logic.What was changed
Added
UserRole.TOPCODER_MANAGERfor the legacy JWT role and updated the permission/documentation helpers to use the enum-backed value.Kept the existing PM-3764 read-parity behavior intact while extending regression coverage for legacy
topcoder_manageraccess through the route guard and read-permission paths.Documented that
topcoder_manageris accepted by both route guards and PermissionService.Any added/updated tests
Added a TokenRolesGuard regression test covering
topcoder_manageragainstObject.values(UserRole)route allowlists.Expanded PermissionService regression coverage for
topcoder_managerproject, member, invite, and attachment read access.Validated with
pnpm lint, targeted auth regression tests, andpnpm build.The full
pnpm testsuite still has the existing unrelated metadata event-bus failures on the currentdevbaseline.