List permissions
GET/api/permisos
Returns a paginated list of permission records joined with profile and module names. Results are ordered by id ascending with a fixed page size of 5 records.
Query parameters
Page number to retrieve. Defaults to
1.Response
true when the query completes without error.Array of permission records for the requested page.
Total number of pages calculated as
ceil(totalRows / 5). Returns 1 when the table is empty.Error response
500
Examples
Success response
200
Create permission
POST/api/permisos
Creates a single permission record linking a profile to a module with specific action flags.
Request body
ID of the profile to assign permissions to.
ID of the module the permissions apply to.
Grant create access.
Grant edit access.
Grant read/list access.
Grant delete access.
Grant detail-view access.
Response
true when the record is inserted successfully.The newly created
permisos_perfil row as returned by the database RETURNING clause.Error responses
| Status | Message | Cause |
|---|---|---|
400 | Perfil y Módulo son obligatorios | idPerfil or idModulo is missing from the request body. |
Examples
Success response
200
Update permission
PUT/api/permisos/:id
Replaces all fields on an existing permission record. You must supply the full set of fields — any boolean omitted is coerced to false.
Path parameters
Primary key of the
permisos_perfil row to update.Request body
ID of the profile.
ID of the module.
Grant create access.
Grant edit access.
Grant read/list access.
Grant delete access.
Grant detail-view access.
Response
true when the update completes.The updated
permisos_perfil row as returned by the database RETURNING clause.Examples
Success response
200
Delete permission
DELETE/api/permisos/:id
Permanently removes a single permission record from the permisos_perfil table.
Path parameters
Primary key of the
permisos_perfil row to delete.Response
true when the delete completes.Always
"Eliminado correctamente".Examples
Success response
200