You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TalentTrust Backend uses Role-Based Access Control (RBAC) to protect API
endpoints. Every protected request must include a valid bearer token that
encodes a user identity and role. The system then checks the role against an
Access Control Matrix before granting access.
Calls isAllowed(role, resource, action) against the matrix.
Returns 403 if denied; calls next() if allowed.
Security Notes
Deny-by-default — unknown roles, resources, or actions are always denied.
No privilege escalation — the matrix is a compile-time constant; it
cannot be mutated at runtime.
Input validation — empty strings and unexpected types are rejected.
Separation of concerns — authentication (identity) and authorization
(permission) are separate middleware layers.
Threat scenario coverage — tests validate: missing headers, malformed
tokens, unknown roles, privilege escalation attempts, and every cell of the
access control matrix.
Testing
# Run all tests
npm test# Run with coverage
npx jest --coverage