The Directorio de Usuarios page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Israel-Perez/Nuxt-Secure/llms.txt
Use this file to discover all available pages before exploring further.
/seguridad/usuario) is the central hub for managing all user accounts in Nuxt Secure. From here you can search, filter, create, edit, and deactivate users.
Overview
The user directory displays a paginated table of all registered users. Each row shows the user’s avatar, username, contact details, assigned profile, and account status. Access to this page requires thebitConsulta permission on the USUARIO module. If you lack this permission, the application redirects you to / before the page renders.
Filtering users
Three filters are available at the top of the table. Filters apply with a 400 ms debounce — the table refreshes automatically as you type.| Filter | Description |
|---|---|
| Search by name | Case-insensitive partial match on strNombreUsuario |
| Assigned profile | Dropdown listing all profiles; select one to narrow results |
| Status | Show all users, only active users, or only inactive users |
Pagination
The table is paginated with 5 records per page. Use the first, previous, next, and last buttons to navigate. The current page number and total pages are shown on the left.Creating a user
Click Nuevo Usuario to open the creation form. This button is only visible if you have bothbitConsulta and bitAgregar on the USUARIO module.
Fill in the required fields
The following fields are required:
- Username (
strNombreUsuario) — the display name for the user - Email (
strCorreo) — must be unique across all users - Password (
strPwd) — minimum length enforced by validation - Assigned profile (
idPerfil) — select from the dropdown of existing profiles
Optionally add contact and photo
- Phone (
strNumeroCelular) — up to 10 digits, optional - Profile photo — click the avatar area or Examinar archivos to select an image (JPG or PNG, max 10 MB before compression). The image is compressed client-side before upload.
Set the account status
The Estado de la cuenta toggle defaults to active. Switch it off to create the user in an inactive state.
Passwords are hashed with bcrypt (10 salt rounds) before being stored in the database. Plain-text passwords are never persisted.
Editing a user
Click the edit icon (pencil) on any row to open the edit form. This action requiresbitEditar on the USUARIO module.
You can change:
- Username, email, phone, assigned profile, and account status
- Profile photo (upload a new image to replace the existing one)
- Password — leave the password field blank to keep the current password unchanged
User status
Each user has an active or inactive status stored inidEstadoUsuario.
- Active (
true) — the user can log in normally - Inactive (
false) — the user cannot log in; displayed with a red badge in the table
Profile photo
Photos are uploaded to Cloudinary via the server-side handler (POST /api/usuario). Before the upload:
- The client compresses the image to 60% quality and a maximum width of 800 px using
compressorjs. - The server further limits dimensions to 1000 px and applies automatic quality optimisation via the Cloudinary transformation pipeline.
- The resulting CDN URL is stored in
imagenUrland displayed as a circular avatar in the table.
Permission gates
Each action in the user directory is independently controlled by theUSUARIO module permissions:
| Permission flag | Controls |
|---|---|
bitConsulta | View the user table and access the page |
bitAgregar | Show the Nuevo Usuario button |
bitEditar | Show the edit button per row |
bitEliminar | Show the delete button per row |
bitDetalle | Show the detail view button per row |
v-if — users without a permission never see the corresponding control.
User data model
Theusuario table is defined in server/database/schema.ts:
| Column | Type | Required | Description |
|---|---|---|---|
id | serial PK | Yes | Auto-increment primary key |
strNombreUsuario | varchar(255) | Yes | Display username |
idPerfil | integer FK | Yes | References perfil.id |
strPwd | varchar(255) | Yes | bcrypt-hashed password |
idEstadoUsuario | boolean | Yes | true = active, false = inactive (default true) |
strCorreo | varchar(255) | Yes | Email address (unique) |
strNumeroCelular | varchar(20) | No | Optional phone number |
imagenUrl | varchar(500) | No | Cloudinary CDN URL for profile photo |
Related pages
Profile management
Create and manage the profiles that are assigned to users.
Permissions matrix
Configure what each profile can do in each module.