OxygenDispatch implements a lightweight role system to separate day-to-day operational access from sensitive administrative functions such as creating or deactivating user accounts. Roles are stored as a plain string column on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Janblack07/OxygenDispatch/llms.txt
Use this file to discover all available pages before exploring further.
users table and checked at the route level via middleware, keeping the authorization model simple and transparent without requiring a dedicated permissions package.
Available roles
Roles are defined inApp\Enums\AppRole as a string-backed enum:
| Role | Description |
|---|---|
PROGRAMADOR | Full access to all application features, including user management. Intended for developers and system owners. |
ADMINISTRADOR | Full access to all application features, including user management. Intended for facility administrators. |
ENCARGADO | Operational access to batches, tanks, dispatches, inventory, and reports. Cannot create, edit, deactivate, or reset passwords for other users. |
PROGRAMADOR and ADMINISTRADOR are treated identically by the route middleware — either role satisfies the access check for protected routes.
Route-level protection
All application routes sit inside a singleauth middleware group. A subset of user-management routes additionally require one of the two administrative roles:
Layer 1 — auth middleware
Every route under the main group (/dashboard, /batches, /tanks, /dispatches, /inventory, etc.) requires an authenticated session. Unauthenticated requests are redirected to the login page.
Layer 2 — role:PROGRAMADOR,ADMINISTRADOR middleware
User CRUD and account-management routes are nested inside a second middleware layer that additionally checks the authenticated user’s role:
ENCARGADO who attempts to access any of these routes will be denied, even though they hold a valid authenticated session.
Protected routes
The following routes are gated behindrole:PROGRAMADOR,ADMINISTRADOR and are inaccessible to ENCARGADO users:
| Method | URI | Action |
|---|---|---|
GET | /users | List all users |
POST | /users | Create a new user |
GET | /users/{user} | View a user’s profile |
PUT / PATCH | /users/{user} | Update a user’s details or role |
DELETE | /users/{user} | Delete a user |
POST | /users/{user}/toggle-active | Activate or deactivate a user account |
POST | /users/{user}/reset-password | Reset a user’s password |
Entity types for clients
Client records carry anEntityType classification used to categorize dispatch recipients and filter monthly exit reports. The type is stored as a backed integer enum (App\Enums\EntityType):
| Value | Integer | Label | Use case |
|---|---|---|---|
ENTIDAD | 1 | Entidad | Institutional clients (hospitals, clinics, etc.) |
INTRADOMICILIARIO_IESS | 2 | Intradomiciliario IESS | IESS home-care patients |
NO_AFILIADO_APOYO | 3 | No afiliado / Apoyo | Unaffiliated recipients or support cases |
Every
users record also carries an is_active boolean flag. Users with is_active = false cannot log in, regardless of their role. The toggle-active endpoint (POST /users/{user}/toggle-active) flips this flag and is available only to PROGRAMADOR and ADMINISTRADOR roles. Use this flag to suspend access without permanently deleting the account.