Perfil) is the unit of access control in WebCorporativa. Instead of assigning permissions directly to individual users, you assign a profile to each user. The profile determines everything that user is allowed to do.
Profile model
The following fields make up a profile record:| Field | Type | Constraints | Description |
|---|---|---|---|
IdPerfil | int | Primary key, auto-generated | Unique profile identifier |
strNombrePerfil | string | Required, max 80 chars | Display name for the profile |
BitAdministrador | bool | Default: false | When true, grants all permissions on all modules automatically |
Administrator flag
WhenBitAdministrador is true, the API automatically injects permission claims for every registered module into the JWT at login time. You do not need to configure individual module permissions for an administrator profile — they are granted implicitly.
When BitAdministrador is false, access is limited to the module permissions explicitly granted via POST /api/PermisosPerfil. Any module action not explicitly granted returns 403 Forbidden.
See Permissions for the full bypass logic and how the esAdmin claim is set in the token.
One profile per user
Every user has exactly one active profile at a time, set by theIdPerfil field on the user record. You assign the profile when creating the user. To change a user’s access level, update their IdPerfil — the change takes effect on their next login, when a new token is issued with the updated permission set.
Changing a user’s profile does not invalidate their current JWT. The old token remains valid until it expires (30 minutes). Plan profile changes accordingly in time-sensitive scenarios.
Profile → PermisosPerfil → Modulos
Profiles do not store permissions directly. Instead, they are linked to modules through a join table: EachPermisosPerfilModel row ties one profile to one module and specifies which of the five actions (agregar, editar, consulta, eliminar, detalle) are enabled for that combination.
Managing profiles
Profiles are managed through the/api/Perfil endpoints:
List profiles
Retrieve all profiles registered in the system.
Create a profile
Create a new profile with a name and optional administrator flag.
Update a profile
Rename a profile or toggle the
BitAdministrador flag.Delete a profile
Remove a profile. Users assigned to the deleted profile will lose their access on next login.
Default seeded profile
The API seeds one profile on first startup:| Field | Value |
|---|---|
strNombrePerfil | Administrador Master |
BitAdministrador | true |
admin user. It cannot be removed without first reassigning or removing all users attached to it.
Related pages
Modules
What modules are and how the Clave field maps to permission strings.
Users
How users are created and how profile assignment works.
Permissions
How permission strings are enforced at the endpoint level.
Permissions API
Save and retrieve per-profile module permissions.