Overview
The user management module lets ADMIN users view and manage all system accounts. Every user in ICP System is assigned one or more roles that determine which modules and actions they can access. Role enforcement is applied both in the navigation (menu items are conditionally rendered) and at the API level.The Usuario Data Model
Each user record returned by the API has the following shape:
roles field is stored and transmitted as a single comma-separated string. The UI splits it on , to render individual role badges for each user row.
User List Page (/usuarios)
When you navigate to /usuarios, the page fetches all users from the REST API:
| Column | Description |
|---|---|
| ID | usuario_id — numeric primary key |
| Usuario | username — the login name, displayed in bold |
email — displays "-" if null | |
| Roles | Each role rendered as an individual badge chip |
| Estado | Green ACTIVO badge when is_active === 1, red INACTIVO otherwise |
| Acciones | Buttons: Ver, Editar, Reset, Desactivar |
- Ver — view the user’s details
- Editar — modify the user’s information
- Reset — reset the user’s password
- Desactivar — deactivate the account (sets
is_activeto0)
Profile Page (/perfil)
Every authenticated user — regardless of role — can access their own profile at /perfil. The profile page calls:
- Avatar showing the user’s initials
- Account status chip (Activo / Inactivo)
- Information section:
usuario_id,username,email - Roles section: each assigned role rendered as a chip
- Cerrar sesión button — clears
access_tokenfromlocalStorageand redirects to/login
Roles
ICP System defines three roles. A user can hold multiple roles simultaneously; theroles string would then be comma-separated (e.g., "ADMIN,NOC").
ADMIN
Full access to every module, including Users management and Excel Import. The only role that can see and use the
/usuarios route.OPERADOR
Access to all operational modules including Excel Import. Cannot access the Users management page.
NOC
Read-only access to operational modules. Cannot access Excel Import or Users management.
Module Access Matrix
| Module | ADMIN | OPERADOR | NOC |
|---|---|---|---|
Perfil (/perfil) | ✓ | ✓ | ✓ |
| Proveedores | ✓ | ✓ | ✓ |
| Equipos Principales | ✓ | ✓ | ✓ |
| Enlaces Proveedor | ✓ | ✓ | ✓ |
| Nodos | ✓ | ✓ | ✓ |
| Clientes Corporativos | ✓ | ✓ | ✓ |
| Servicios Cliente | ✓ | ✓ | ✓ |
| Contratos | ✓ | ✓ | ✓ |
| Reportes | ✓ | ✓ | ✓ |
| Importación Excel | ✓ | ✓ | ✗ |
Usuarios (/usuarios) | ✓ | ✗ | ✗ |
The hasRole() Utility
Role checks across the application use a single utility function defined in src/shared/auth/rbac.ts:
true if the user holds any of the listed roles.
Examples used in AppLayout.tsx: