Overview
The PAE Inventory System implements a hierarchical role-based access control system with four distinct user roles. Each role has specific permissions designed to maintain data integrity and enforce the maker-checker approval workflow.User Roles
1. Director (Role ID: 1)
Authority Level: Highest operational authority Key Permissions:- Approve or reject entry guides (guías de entrada)
- Create and manage products/inventory items
- Create and manage users (except other Directors and Developers)
- Register daily operations
- Configure portion yields
- Full read access to all data and audit logs
- Cannot modify or delete other Director accounts
- Cannot assign the Director role (only Developers can)
- Cannot modify their own account from user management interface
2. Madre Procesadora (Role ID: 2)
Authority Level: Operational manager Key Permissions:- Create entry guides (guías de entrada) - guides remain “Pendiente” until Director approves
- Create and update products/inventory items
- Register daily operations and attendance
- Configure portion yields
- Full read access to all data
- Cannot approve or reject entry guides
- Cannot manage users
- Cannot delete products (only Director can)
3. Supervisor (Role ID: 3)
Authority Level: Read-only Key Permissions:- View all products, inventory, and reports
- View entry guides and their approval status
- View daily operations and attendance records
- View audit logs
- Cannot create, update, or delete any data
- Cannot approve entry guides
- Cannot manage users
- All action buttons are hidden from the UI
4. Desarrollador (Role ID: 4)
Authority Level: Technical administrator (highest system-level authority) Key Permissions:- All permissions of Director role
- Can create Director accounts
- Can modify any user except themselves (from UI)
- Full database access for system maintenance
- Can only be assigned directly from the database
- Cannot be assigned through the application UI
- Cannot modify their own account from user management
The Desarrollador role is protected at the database level and cannot be assigned through the application interface. Only database administrators can assign this role.
Role Hierarchy
Permission Matrix
| Feature | Director | Madre Procesadora | Supervisor | Desarrollador |
|---|---|---|---|---|
| Products | ||||
| View products | ✓ | ✓ | ✓ | ✓ |
| Create products | ✓ | ✓ | ✗ | ✓ |
| Update products | ✓ | ✓ | ✗ | ✓ |
| Delete products | ✓ | ✗ | ✗ | ✓ |
| Entry Guides | ||||
| View entry guides | ✓ | ✓ | ✓ | ✓ |
| Create entry guides | ✓ | ✓ | ✗ | ✓ |
| Approve/reject guides | ✓ | ✗ | ✗ | ✓ |
| Daily Operations | ||||
| View operations | ✓ | ✓ | ✓ | ✓ |
| Register operations | ✓ | ✓ | ✗ | ✓ |
| Portion Management | ||||
| View portions | ✓ | ✓ | ✓ | ✓ |
| Configure portions | ✓ | ✓ | ✗ | ✓ |
| User Management | ||||
| View users | ✓ | ✓ | ✓ | ✓ |
| Create users | ✓ | ✗ | ✗ | ✓ |
| Update users | ✓ | ✗ | ✗ | ✓ |
| Create Directors | ✗ | ✗ | ✗ | ✓ |
| Audit Logs | ||||
| View audit logs | ✓ | ✓ | ✓ | ✓ |
Database-Level Protection
The system enforces role permissions through PostgreSQL triggers and Row Level Security (RLS) policies:Trigger Protection (from supabase_schema.sql:213-291)
RLS Policies (from supabase_schema.sql:738-743)
How to Check Your Role
Your current role is displayed in:- Profile menu - Click your username in the top-right corner
- Dashboard - Shows your role name and permissions
- Navigation menu - Only shows features you have access to
Related Resources
Entry Approval Workflow
Learn about the maker-checker approval process
Managing Products
How to create and manage inventory items