/api/permisos/guardar-matriz
Replaces all permission records for a given profile atomically:
- Deletes every existing
permisos_perfilrow whereidPerfilmatches. - Inserts the new set of rows supplied in the
permisosarray.
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 thepermisos field entirely: