Modulo) represents a discrete section or feature of your application. Modules are the targets of permission grants — you don’t assign permissions to abstract roles, you assign them to specific modules. Every protected endpoint in WebCorporativa maps to exactly one module.
Module model
| Field | Type | Constraints | Description |
|---|---|---|---|
IdModulo | int | Primary key, auto-generated | Unique module identifier |
strNombreModulo | string | Required, max 100 chars | Human-readable display name |
Ruta | string | Required, max 50 chars | Frontend route for this module (e.g. /Module/Usuario) |
Clave | string | Required, max 50 chars, unique | Short key used as the prefix in permission strings |
The Clave field
Clave is the unique identifier that links a module to its permission strings. When the API constructs or checks a permission, it uses the module’s Clave as the prefix:
Clave = "usuario" produces the following permission strings:
| Permission string | Action |
|---|---|
usuario.agregar | Create a user |
usuario.editar | Edit a user |
usuario.eliminar | Delete a user |
usuario.consultar | List or search users |
usuario.detalle | Retrieve a single user |
The Ruta field
Ruta stores the frontend route that maps to this module (for example, /Module/Usuario). The API returns this value in the GET /api/Menu response so your client can build navigation links without hard-coding routes.
Built-in seeded modules
The following modules are seeded automatically on first startup. TheirClave values are used throughout the permission system:
| Display name | Ruta | Clave |
|---|---|---|
| Modulos | /Module/Modulos | modulo |
| Perfil | /Module/Perfil | perfil |
| PermisosPerfil | /Module/PermisosPerfil | permisosperfil |
| Usuario | /Module/Usuario | usuario |
| Principal 1.1 | /Principales/PrincipalU1 | principal11 |
| Principal 1.2 | /Principales/PrincipalU2 | principal12 |
| Principal 2.1 | /Principales/PrincipalD1 | principal21 |
| Principal 2.2 | /Principales/PrincipalD2 | principal22 |
These modules are registered at application startup. If you delete a seeded module, its permission grants for all profiles are also removed. Endpoints that enforce those permissions will return
403 Forbidden for all non-administrator users.Adding custom modules
You can register additional modules through the/api/Modulo endpoints. Once a module is created, you can grant permissions for it to any profile via POST /api/PermisosPerfil. The module’s Clave becomes the prefix for all permission strings associated with it.
reportes.agregar, reportes.consultar, and so on.
Managing modules
List modules
Retrieve all registered modules.
Create a module
Register a new module with a unique Clave.
Update a module
Update a module’s name, route, or key.
Delete a module
Remove a module and all associated permission grants.
Related pages
Profiles
How profiles collect module permissions and assign them to users.
Permissions
The full permission string reference and how enforcement works.
Dynamic menu
How the API uses modules to build the authenticated user’s navigation menu.