Overview
APTIV Scrap Control implements a 4-tier role-based access control (RBAC) system to ensure users only access features appropriate for their responsibilities.Role Hierarchy
Administrator
Full system access with user and permission management
Quality (Calidad)
Quality control with reporting and catalog management
Supervisor
Production line supervision with area-level reporting
Operator (Operador)
Basic scrap registration and record viewing
Permission Matrix
The following table shows the complete permission matrix for all roles:| Permission | Admin | Quality | Supervisor | Operator |
|---|---|---|---|---|
| Register scrap | ✅ | ✅ | ✅ | ✅ |
| View own records | ✅ | ✅ | ✅ | ✅ |
| View area reports | ✅ | ✅ | ✅ | ❌ |
| View global reports | ✅ | ✅ | ❌ | ❌ |
| Edit today’s records | ✅ | ✅ | ✅ | ❌ |
| Delete records | ✅ | ✅ | ❌ | ❌ |
| Manage catalogs | ✅ | ✅ | ❌ | ❌ |
| Manage users | ✅ | ❌ | ❌ | ❌ |
| Configure permissions | ✅ | ❌ | ❌ | ❌ |
| Manage tolerances | ✅ | ✅ | ❌ | ❌ |
| Export backups | ✅ | ❌ | ❌ | ❌ |
| View audit logs | ✅ | ✅ | ❌ | ❌ |
| Import CSV | ✅ | ✅ | ❌ | ❌ |
| Export CSV | ✅ | ✅ | ✅ | ❌ |
Permissions are configurable from the administration panel. The matrix above shows default settings.
Permission Types
TypeScript Definition
Permissions are defined as a union type in the system:types.ts
Detailed Permission Descriptions
register_scrap - Register Scrap Entries
register_scrap - Register Scrap Entries
Allows users to create new scrap records. All roles have this permission as it’s the primary function of the system.Granted to: Admin, Quality, Supervisor, Operator
view_own_records - View Personal Records
view_own_records - View Personal Records
View scrap records created by the logged-in user. Essential for all users to verify their entries.Granted to: Admin, Quality, Supervisor, Operator
view_area_reports - View Area-Level Reports
view_area_reports - View Area-Level Reports
Access reports filtered to the user’s assigned production area. Required for line supervision.Granted to: Admin, Quality, Supervisor
view_global_reports - View All Reports
view_global_reports - View All Reports
Access organization-wide reports across all areas and production lines. Required for quality analysis.Granted to: Admin, Quality
edit_today_records - Edit Current Day Records
edit_today_records - Edit Current Day Records
Modify scrap entries created on the current day. Prevents historical data manipulation.Granted to: Admin, Quality, Supervisor
delete_records - Delete Records
delete_records - Delete Records
Soft-delete scrap entries (marks as ELIMINADO=1). Required for correcting errors.Granted to: Admin, Quality
manage_catalogs - Manage System Catalogs
manage_catalogs - Manage System Catalogs
Create, update, and delete catalog entries (parts, defects, areas, shifts, lines).Granted to: Admin, Quality
manage_users - User Account Management
manage_users - User Account Management
Create user accounts, reset passwords, assign roles, and deactivate users.Granted to: Admin only
manage_permissions - Configure Role Permissions
manage_permissions - Configure Role Permissions
Modify the permission matrix and create custom roles. Highest-level administrative function.Granted to: Admin only
manage_tolerances - Configure Tolerance Limits
manage_tolerances - Configure Tolerance Limits
Set acceptable scrap thresholds by area, chain, line, or category.Granted to: Admin, Quality
export_backup - Export System Backup
export_backup - Export System Backup
Download complete database backups in JSON or SQL format.Granted to: Admin only
view_audit - View Audit Logs
view_audit - View Audit Logs
Access the audit trail showing all system changes with user attribution.Granted to: Admin, Quality
import_catalogs - Import Catalog Data
import_catalogs - Import Catalog Data
Bulk import catalog entries from CSV files.Granted to: Admin, Quality
export_catalogs - Export Catalog Data
export_catalogs - Export Catalog Data
Download catalog data and reports in CSV format.Granted to: Admin, Quality, Supervisor
Role Data Structure
types.ts
Database Schema
schema.sql
Permission Checking
Frontend Permission Check
TheusePermissions hook provides a can() function to check permissions:
useStore.ts
Usage Example
Configuring Permissions
Creating Custom Roles
While the system ships with 4 default roles, administrators can create custom roles:Best Practices
Principle of Least Privilege
Grant users only the permissions they need for their job function
Regular Audits
Review user permissions quarterly to remove unnecessary access
Document Custom Roles
Maintain documentation for any custom roles created
Test Permission Changes
Always test with a non-admin account before rolling out changes
Related Pages
User Management
Creating and managing user accounts
Audit Logs
Tracking permission changes and usage