Skip to main content
GET /api/permisos/mis-permisos/:idPerfil Joins permisos_perfil with modulo and returns a Record<string, PermisosAccion> indexed by the uppercased module name. This is the key endpoint for RBAC enforcement in the frontend. useAuth.ts calls this endpoint inside cargarMisPermisos() immediately after a successful login and again when the session is restored on page refresh. The result is stored in the global misPermisos state and later checked via tienePermiso(nombreModulo, accion).

Path parameters

number
required
ID of the profile whose permission map you want to load.

Response

boolean
required
true when the query completes without error.
object
required
A plain object whose keys are uppercase module names (e.g. "USUARIO", "PERFIL") and whose values are PermisosAccion objects. Returns an empty object {} when the profile has no assigned permissions.

PermisosAccion interface

Defined in app/composables/useAuth.ts:
The global permissions state is typed as Record<string, PermisosAccion> and accessed via tienePermiso(nombreModulo, accion), which looks up the module name in uppercase and returns false if the key does not exist:

Error response

500

Examples

Success response

The response key permisos is a plain object — not an array. Each key is the module name in uppercase exactly as stored in the modulo table.
200
Each value object includes nombreModulo because the server selects it from the modulo join alongside the permission flags. Only the boolean flag fields are used by tienePermiso(); nombreModulo is informational.