feat(auth): add Monitoring role with read access to financial dashboard#3727
Open
TaprootFreak wants to merge 1 commit into
Open
feat(auth): add Monitoring role with read access to financial dashboard#3727TaprootFreak wants to merge 1 commit into
TaprootFreak wants to merge 1 commit into
Conversation
davidleomay
reviewed
May 20, 2026
Member
There was a problem hiding this comment.
Add [UserRole.MONITORING]: [UserRole.ADMIN, UserRole.SUPER_ADMIN], to additionalRoles -> can remove admin on dashboard controller endpoints
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.
Summary
MONITORINGuser role with read-only access to the financial dashboard endpoints.ADMIN⊃COMPLIANCE⊃MONITORING— all three roles are explicitly listed on the affected guards so each can hit the endpoints without changing the existingadditionalRoleshierarchy map.RoleGuardto accept multiple entry roles (variadic, backward-compatible — existing single-arg call sites are unaffected).Changes
src/shared/auth/user-role.enum.ts: addMONITORING = 'Monitoring'(positioned afterMARKETING, before service / external roles).src/shared/auth/role.guard.ts: makeRoleGuard(...entryRoles)variadic;canActivatereturns true if the request role matches (or is in theadditionalRolesof) any of the supplied entry roles.src/subdomains/supporting/dashboard/dashboard-financial.controller.ts: widen guards on all four endpoints (GET /dashboard/financial/log,/latest,/changes/latest,/ref-recipients,/changes) fromRoleGuard(ADMIN)toRoleGuard(ADMIN, COMPLIANCE, MONITORING).Test plan
npm run lintnpm run format(no diff)npm run type-checknpm run buildnpm test(938 passed, 106 skipped — unchanged baseline)Monitoringrole and verify they can hit the five financial dashboard endpoints; verify they cannot hit other admin-only endpoints.Migration notes
None — additive enum value + guard widening only. No DB / schema changes.
Coordination
Touches a different file than the in-flight PR #3725 (
perf/dashboard-financial-log-optimizationmodifies the service, this PR modifies the controller + auth) — no merge conflicts expected.