Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ChrisCore1/inventario_sud/llms.txt

Use this file to discover all available pages before exploring further.

User management in Inventario SUD is restricted to accounts holding the Obispo role. Only an Obispo can create new users, update account details, or remove users from the system. All other roles have read-only access to their own profile and cannot administer other accounts.

Create a new user

1

Navigate to Configuración

Sign in as an Obispo and go to Configuración in the sidebar. The user management panel loads automatically.
2

Open the new user form

Click the Agregar usuario button at the top of the user list to open the creation form.
3

Fill in the required fields

Enter the user’s full name, email address, and a temporary password. All three fields are required — the form will not submit if any are blank.
4

Select a role

Choose a role from the dropdown. The available roles are Obispo and the standard user role. See Roles and permissions for what each role can do.
5

Submit the form

Click Guardar. The new account is created immediately and the user list refreshes. The action is recorded in the audit log.
If the email address is already registered, the form returns the error: “El correo electrónico ya está registrado.” Each email address must be unique across all accounts.

Edit a user

1

Locate the user

In Configuración, find the user in the accounts table.
2

Open the edit form

Click the edit icon next to the user’s row. The form pre-fills with the current name, email, and role.
3

Update the fields

Change the name, email, or role as needed. Password changes are handled separately through the security settings panel.
4

Save changes

Click Guardar. The record is updated and the page revalidates. The change is written to the audit log.

Delete a user

1

Locate the user

In Configuración, find the account you want to remove.
2

Click the delete button

Click the delete icon next to the user’s row. A confirmation prompt appears.
3

Confirm deletion

Confirm the action. The account is permanently removed from the database.
Users who have audit log entries or active loan records associated with their account cannot be deleted. The database enforces foreign key constraints on the Auditoria_log and Movimiento_Prestamos tables. If deletion fails, the system returns the error: “No se puede eliminar el usuario. Es posible que tenga registros asociados en auditoría o préstamos.” Reassign or archive those records before attempting deletion.

The UsuarioConRol interface

The following TypeScript interface represents each user as returned by the Configuración page query. It is defined in types/index.ts.
export interface UsuarioConRol {
  id_usuario: number;
  nombre_usuario: string;
  email: string;
  id_rol: number;
  nombre_rol: string;
  is_active: boolean | null;
}
FieldTypeDescription
id_usuarionumberPrimary key for the user record.
nombre_usuariostringDisplay name shown in the UI and audit log.
emailstringUnique login email. Used as the NextAuth identity.
id_rolnumberForeign key referencing the Rol table.
nombre_rolstringHuman-readable role name joined from Rol.
is_activeboolean | nullWhether the account is currently active.
Every user management action — creation, update, and deletion — is automatically recorded in the audit log with the acting user’s ID, a timestamp, and the originating IP address. See Review the system audit log for details.

Build docs developers (and LLMs) love