Amvel Warehouse uses two roles:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phauline-racel/LIMO-YUSEN-WAREHOUSE/llms.txt
Use this file to discover all available pages before exploring further.
admin and employee. A user’s role is assigned when their account is created and is stored inside the session object after a successful login. On every protected page load, the application reads the active session and checks the role to decide whether to grant or deny access. There is no guest access — all pages under /pages/ require an authenticated session.
Role Comparison
The table below summarises what each role can and cannot do across the system.| Feature | Admin | Employee |
|---|---|---|
| View Dashboard | ✓ | ✓ |
| Inbound & Outbound | ✓ | ✓ |
| Inventory | ✓ | ✓ |
| Shipment Details | ✓ | ✓ |
| User Management | ✓ | ✗ |
| Create / Edit / Delete Users | ✓ | ✗ |
| Reset Passwords | ✓ | ✗ |
| View All Accounts | ✓ | ✗ |
| Change Own Password | ✓ | ✓ |
| Edit Own Profile | ✓ | ✓ |
How Route Guards Work
Every page inside the/pages/ directory calls guardPageAccess() from assets/app.js on load. The function runs two checks in sequence:
-
Authentication check —
AuthService.isAuthenticated()looks for a valid session inlocalStorage. If no session is found and the current URL path contains/pages/, the browser is redirected to../index.html(the login screen). -
Admin-only route check — If the current URL path matches the regex
/\/admin|\/settings|user-management/i, the function additionally verifies thatAuthService.getCurrentUser().role === 'admin'. If the logged-in user is not an admin, the browser is redirected todashboard.html.
guardPageAccess() checks, nav link visibility is also role-aware: elements with the CSS class admin-only-nav (such as the User Management dropdown link) are shown only when isAdminUser() returns true. Employee sessions leave those elements hidden.
The
isAdminRoute regex is /\/admin|\/settings|user-management/i. Any page whose URL path contains /admin, /settings, or user-management is treated as an admin-only route and requires the admin role to access.Session Persistence
When a user logs in successfully,AuthService.authenticateUser() writes a session object to localStorage under the key warehouseAuthSession. The session contains:
localStorage rather than sessionStorage, closing the browser tab does not log the user out. The session remains active until one of the following occurs:
- The user clicks Logout, which calls
AuthService.logout()and removes thewarehouseAuthSessionkey. - The browser’s local storage is manually cleared.