Register a new module in the system.
curl --request POST \
--url https://your-api-host/api/Modulo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}'
{
"IdModulo": 4,
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}
Clave value you supply becomes the prefix for all permission strings associated with this module.
Authorization: Bearer <token>
modulo.agregar permission. Returns 403 Forbidden if the authenticated user’s profile does not have this permission.
Clave you set here determines the permission string prefix. For example, a Clave of reports generates permissions such as reports.agregar, reports.editar, and reports.eliminar.Clave already exists, the request is rejected with 400 Bad Request and the message "Ya existe un módulo con la misma clave."Clave and Ruta combination already exists, the request is rejected with 400 Bad Request and the message "Ya existe un módulo con la misma clave y ruta."curl --request POST \
--url https://your-api-host/api/Modulo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}'
{
"IdModulo": 4,
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}
curl --request POST \
--url https://your-api-host/api/Modulo \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}'
{
"IdModulo": 4,
"strNombreModulo": "Reportes",
"Ruta": "/Module/Reporte",
"Clave": "reporte"
}