Skip to main content
POST /api/permisos/guardar-matriz Replaces all permission records for a given profile atomically:
  1. Deletes every existing permisos_perfil row where idPerfil matches.
  2. Inserts the new set of rows supplied in the permisos array.
This is what the admin UI calls when a user clicks Guardar Permisos after editing the permissions matrix. Sending an empty permisos array effectively removes all permissions for the profile.

Request body

number
required
ID of the profile whose permissions matrix will be replaced. The handler deletes all existing rows for this profile before inserting the new ones.
object[]
Array of permission entries to insert. If omitted or empty, all existing permissions for the profile are deleted and nothing is inserted.

Response

boolean
required
true when the delete-and-insert cycle completes without error.
string
required
Always "Matriz actualizada correctamente" on success.

Error responses

Examples

Success response

200

Error response (400)

400

Clearing all permissions

To remove every permission for a profile without assigning new ones, send an empty array or omit the permisos field entirely: