Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ttpullima/RomsoftBackEnd2021_v2/llms.txt

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

Roles are the primary access-control primitive in the Romsoft Gestión Clínica security model. Every user account in SEG_USUARIO is assigned exactly one role via its id_rol foreign key, and that role determines which system functions the user may access. The SEG_ROL controller exposes a single read-only endpoint that returns all currently active roles — the canonical list to use when populating role selection drop-downs during user creation or update workflows. Role definitions themselves (creation, modification, deactivation) are managed directly at the database level and are not exposed through the API surface.
The SEG_ROL controller exposes only GetAllActives. Create, update, and delete operations for roles are managed in the database and are not accessible via the REST API. Treat role data as reference / lookup data.

Endpoint

POST /api/SEG_ROL/GetAllActives
This endpoint requires a valid Bearer token. No request body is needed — simply issue the POST with an empty body or omit the body entirely.

Request

No request body is required. The endpoint retrieves all roles whose estado column indicates an active record, with no filter parameters accepted.
curl -X POST https://<your-server>/api/SEG_ROL/GetAllActives \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>"

Response

The standard JsonResponse envelope is returned. On success, Data contains an array of SEG_ROLDTO objects, one per active role.
Success
boolean
true when the query executed without a server-side exception.
Warning
boolean
Not set by this endpoint under normal operation.
Message
string
Populated only on error: "Hubo un error, inténtelo más tarde." if an exception is caught.
Data
array
An array of SEG_ROLDTO objects representing every active role in the system.

Sample Response

{
  "Success": true,
  "Warning": false,
  "Message": null,
  "Data": [
    {
      "id_rol": 1,
      "rol": "ADMIN",
      "descripcion": "Administrador del sistema con acceso completo a todos los módulos.",
      "estado": "A",
      "FechaCreacion": "2021-01-15T08:00:00",
      "FechaModificacion": null,
      "UsuarioCreacion": "admin",
      "UsuarioModificacion": null,
      "IdUsuarioActual": 0,
      "id_usuarioCreacion": 1,
      "id_usuarioModifica": 0
    },
    {
      "id_rol": 2,
      "rol": "MEDICO",
      "descripcion": "Médico con acceso a historia clínica, citas y prescripciones.",
      "estado": "A",
      "FechaCreacion": "2021-01-15T08:00:00",
      "FechaModificacion": null,
      "UsuarioCreacion": "admin",
      "UsuarioModificacion": null,
      "IdUsuarioActual": 0,
      "id_usuarioCreacion": 1,
      "id_usuarioModifica": 0
    },
    {
      "id_rol": 3,
      "rol": "RECEPCION",
      "descripcion": "Personal de recepción con acceso a registro de pacientes y agenda de citas.",
      "estado": "A",
      "FechaCreacion": "2021-01-15T08:00:00",
      "FechaModificacion": null,
      "UsuarioCreacion": "admin",
      "UsuarioModificacion": null,
      "IdUsuarioActual": 0,
      "id_usuarioCreacion": 1,
      "id_usuarioModifica": 0
    }
  ]
}

Error Response

If an unhandled exception occurs while fetching role data, the controller catches it, logs the error through BaseController.LogError(), and returns a failure envelope:
{
  "Success": false,
  "Warning": false,
  "Message": "Hubo un error, inténtelo más tarde.",
  "Data": null
}

Usage Pattern — Populating Role Selection Lists

The most common use of this endpoint is to populate a role drop-down before creating or editing a user. Fetch the active role list once per session and cache it client-side for the duration of the management workflow.
Call GetAllActives when your user management screen loads, then map the returned id_rolrol pairs into your drop-down. When creating a new user via POST /api/SEG_USUARIO/Add, submit the selected id_rol integer value in the request body.
// Pseudocode — fetch active roles and populate a select element
const response = await fetch('/api/SEG_ROL/GetAllActives', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  }
});

const { Success, Data } = await response.json();

if (Success && Data) {
  const roleOptions = Data.map(r => ({
    value: r.id_rol,
    label: `${r.rol}${r.descripcion}`
  }));
  // bind roleOptions to your UI select component
}

Build docs developers (and LLMs) love