Overview
The User Management module allows administrators to create, edit, and manage user accounts across the P.FLEX industrial ERP system. Each user is assigned a role that determines their permissions and accessible areas.User Data Model
TheAppUser interface defines the core user structure:
Unique identifier for the user account
Full name of the user (e.g., “Juan Pérez”)
Login username for authentication
Assigned role determining permissions. Valid values:
Jefatura- Management level accessSupervisor- Shift supervision and task assignmentAsistente- Assistant level accessOperario- Production operatorEncargado- Department managerSistemas- System administrator
Account status.
true = active, false = disabledProduction areas accessible to the user (only for
Operario role)Example: ["Impresión", "Troquelado", "Acabado"]User Management Operations
Creating a User
To create a new user account, use theaddAdminUser() method:
Enter User Details
Fill in the required fields:
- Full name (e.g., “Juan Pérez”)
- Username (e.g., “jperez”)
- Select role from dropdown
- Set account status (Active/Inactive)
Assign Production Areas (Operario only)
If role is
Operario, select production areas:- Impresión
- Troquelado
- Acabado
- Empaquetado
Updating a User
Modify existing user accounts usingupdateAdminUser():
All user modifications are tracked in the audit log with timestamp, admin user, and change details.
Deleting a User
Remove user accounts usingdeleteAdminUser():
User Interface Features
Search and Filter
The user management interface includes real-time search capabilities:- User name
- Username/email
- Role
Area Assignment for Operators
Production operators (Operario role) can be assigned specific production areas:
- Impresión - Printing operations
- Troquelado - Die-cutting operations
- Acabado - Finishing operations
- Empaquetado - Packaging operations
User Status Management
Users can be set to active or inactive status:Active (
true): User can log in and access the systemInactive (false): User account is disabled and cannot log inAudit Logging
All user management operations are automatically logged:| Action | Log Entry | Details |
|---|---|---|
| Create User | Crear Usuario | Username and assigned role |
| Update User | Editar Usuario | Username of modified account |
| Delete User | Eliminar Usuario | Username of deleted account |
/audit or see Audit Logs documentation.
Permission Requirements
User management requires the
Sistemas or Jefatura role with Gestión Usuarios permission.Best Practices
Security Recommendations
- Use strong usernames that don’t reveal personal information
- Assign the minimum required role for each user
- Regularly review and disable inactive accounts
- For Operarios, only assign areas where they work
- Monitor audit logs for suspicious user changes
Code Reference
Key source files:- Data Model:
src/features/admin/models/admin.models.ts:4-11 - Service Methods:
src/features/admin/services/admin.service.ts:14-40 - UI Component:
src/features/admin/components/admin-users.component.ts - State Management:
src/services/state.service.ts:54-59
