Skip to main content

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.

The Directorio de Usuarios page (/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 the bitConsulta 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.
FilterDescription
Search by nameCase-insensitive partial match on strNombreUsuario
Assigned profileDropdown listing all profiles; select one to narrow results
StatusShow all users, only active users, or only inactive users
Click Limpiar to reset all filters and return to the full list.

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 both bitConsulta and bitAgregar on the USUARIO module.
1

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
2

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.
3

Set the account status

The Estado de la cuenta toggle defaults to active. Switch it off to create the user in an inactive state.
4

Save the record

Click Guardar Registro. The form validates all required fields before submitting. If any field is invalid, a summary error banner appears at the top of the form.
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 requires bitEditar 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 in idEstadoUsuario.
  • Active (true) — the user can log in normally
  • Inactive (false) — the user cannot log in; displayed with a red badge in the table
Deactivating a user is the recommended approach instead of deleting them, to preserve audit history.

Profile photo

Photos are uploaded to Cloudinary via the server-side handler (POST /api/usuario). Before the upload:
  1. The client compresses the image to 60% quality and a maximum width of 800 px using compressorjs.
  2. The server further limits dimensions to 1000 px and applies automatic quality optimisation via the Cloudinary transformation pipeline.
  3. The resulting CDN URL is stored in imagenUrl and displayed as a circular avatar in the table.
Users without a photo show a generated initial avatar based on the first letter of their username.

Permission gates

Each action in the user directory is independently controlled by the USUARIO module permissions:
Permission flagControls
bitConsultaView the user table and access the page
bitAgregarShow the Nuevo Usuario button
bitEditarShow the edit button per row
bitEliminarShow the delete button per row
bitDetalleShow the detail view button per row
Buttons are rendered with v-if — users without a permission never see the corresponding control.

User data model

The usuario table is defined in server/database/schema.ts:
ColumnTypeRequiredDescription
idserial PKYesAuto-increment primary key
strNombreUsuariovarchar(255)YesDisplay username
idPerfilinteger FKYesReferences perfil.id
strPwdvarchar(255)Yesbcrypt-hashed password
idEstadoUsuariobooleanYestrue = active, false = inactive (default true)
strCorreovarchar(255)YesEmail address (unique)
strNumeroCelularvarchar(20)NoOptional phone number
imagenUrlvarchar(500)NoCloudinary CDN URL for profile photo

Profile management

Create and manage the profiles that are assigned to users.

Permissions matrix

Configure what each profile can do in each module.