Skip to main content
GET /api/permisos/por-perfil/:idPerfil Returns every row in the permisos_perfil table that belongs to the given profile. Unlike the My permissions endpoint, this returns the raw table rows (including id and idModulo) without joining module names. It is used by the admin UI to load the current state of the permissions matrix before editing.

Path parameters

idPerfil
number
required
ID of the profile whose permissions you want to retrieve.

Response

success
boolean
required
true when the query completes without error.
data
object[]
required
Array of permisos_perfil rows for the given profile. Returns an empty array when the profile has no assigned permissions.

Error response

500
{
  "statusCode": 500,
  "message": "Error al cargar permisos"
}

Examples

curl --request GET \
  --url 'https://your-domain.com/api/permisos/por-perfil/2' \
  --cookie 'auth_token=<your-jwt>'

Success response

200
{
  "success": true,
  "data": [
    {
      "id": 7,
      "idPerfil": 2,
      "idModulo": 1,
      "bitAgregar": false,
      "bitEditar": true,
      "bitConsulta": true,
      "bitEliminar": false,
      "bitDetalle": true
    },
    {
      "id": 8,
      "idPerfil": 2,
      "idModulo": 3,
      "bitAgregar": false,
      "bitEditar": false,
      "bitConsulta": true,
      "bitEliminar": false,
      "bitDetalle": false
    }
  ]
}

Build docs developers (and LLMs) love