Repository navigation
refactor(auth): acceso por rol con lista de permitidos - #9
Merged
bpstack merged 5 commits intoOct 12, 2026
Merged
Conversation
- Test excludeMantenimiento with 4 roles + missing user + uppercase - Test canOpenModule with 4 roles x 6 modules matrix - Verify 9 routers use excludeMantenimiento middleware
- excludeMantenimiento now uses allowedRoles = ['admin', 'recepcionista', 'group-admin'] instead of blockedRoles = ['mantenimiento'], so unknown roles are denied by default - module-access.ts: rename allButMaintenanceRole to frontDeskRoles with an explicit allowlist - role-access.test.ts: add 'auditor' role case (403 in middleware, false in all 6 modules)
…ny role - module-access.ts: export FRONT_DESK_ROLES and build frontDeskRoles on it. - roleCheck.ts: excludeMantenimiento reads FRONT_DESK_ROLES instead of its own copy, and its 403 no longer says the role only reaches maintenance. Why: the allowlist lived in two files that had to be kept in step, and after the switch to an allowlist the old message was wrong for any role other than mantenimiento.
- Remove the "excludeMantenimiento is an exclusion list" entry. Why: the guard and module-access.ts share FRONT_DESK_ROLES, an allowlist; role-access.test.ts pins the four roles and denies an unknown one.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Cambios
excludeMantenimientopasa de excluirmantenimientoa una lista de roles permitidos (FRONT_DESK_ROLES, compartida desdemodule-access.ts).docs/TODO.md: se borra el punto, ya hecho.Por qué
Con una lista de exclusión, cualquier rol nuevo entraba por defecto en parking, lista negra, grupos y demás.