Security
Reference
Public
Reference
Technical reference for the ERPat Security module — controllers, routes, models, views, migrations, database tables and columns, permission keys, menu entries, and system-audit-log event keys for Device Management, Offsite Access, Locked Accounts, Active Sessions, and Access Device Logs.
Guide version: r1
Module version: 1.1.0 Updated: 2026-08-28 Estimated time: 14 min 10 views 0% helpful
Administration & Reference
Reference
The data-and-screen reference for the Security module — controllers, routes,
tables, permission keys, menu entries, and audit-log events. Everything here is drawn from
the live module source; see Research for the exact files.
Controllers
| Controller | Tool | Key methods |
OffsiteAccess |
Offsite Access |
index, modalForm, save, listData, delete |
Locked_Accounts |
Locked Accounts + Active Sessions |
index, locked_accounts_view, active_sessions_view, list_data, clear_attempts, list_sessions_data, view_sessions_modal, logout_user_all_devices, delete_session, get_session_statistics |
Access_logs |
Access Device Logs — Logs tab (page shell) |
index (tabbed shell), view, list_data, log_action, delete |
Access_devices |
Access Device Logs — Devices tab |
index, list_data, modal_form, modal_form_credential, generate_new_secret, save, delete, pass_list |
Access_device_categories |
Access Device Logs — Categories tab |
index, list_data, modal_form, save, delete |
All five extend App_Controller (staff, session-authenticated). Each constructor
gates access: Offsite Access on module_offsite_access + offsite_access;
the two Access Device controllers on module_access + access_logs;
Locked Accounts on locked_accounts (or the core staff_support).
Routes
Declared in modules/Security/config/routes.php (mixed-case/underscore controllers
need explicit lowercase routes). The (:any) catch-alls map to controller methods.
| URL | Resolves to |
offsite_access | OffsiteAccess/index |
offsite_access/(:any) | OffsiteAccess/$1 |
locked_accounts | Locked_Accounts/index |
locked_accounts/(:any) · /(:any)/(:any) | Locked_Accounts/$1 · $1/$2 |
access_logs · access_logs/(:any) | Access_logs/index · $1 |
access_devices · access_devices/(:any) | Access_devices/index · $1 |
access_device_categories · …/(:any) | Access_device_categories/index · $1 |
Database tables
Four tables, all shipping in the base-install schema and re-created idempotently by the
module migrations (tracked in migrations_security). All carry the standard
updated_at + deleted audit columns.
offsite_access
| Column | Type | Notes |
id | int unsigned | PK |
uuid | varchar(36) | Per-grant UUID (v4) |
user_id | int | Staff member granted the window |
start_date / end_date | date | The exception window |
date_created | datetime | UTC create time |
created_by | int | Granting admin |
updated_at · deleted | timestamp · tinyint | Audit + soft delete |
access_device_categories
| Column | Type | Notes |
id | int unsigned | PK |
title | varchar(150) | Category name |
detail | text | Optional description |
status | tinyint | 1 = active |
updated_at · deleted | timestamp · tinyint | Audit + soft delete |
access_devices
| Column | Type | Notes |
id | int unsigned | PK |
api_key | varchar(36) | UUID the device presents |
api_secret | varchar(120) | Hashed secret (never shown/logged in clear) |
device_name | varchar(36) | Display name |
passes | text | Comma-separated staff user IDs allowed through |
remarks | text | Optional notes |
category_id | int | FK-by-value to access_device_categories |
labels | text | Labels |
status | tinyint | 1 = active |
updated_at · deleted | timestamp · tinyint | Audit + soft delete |
access_logs
| Column | Type | Notes |
id | int unsigned | PK |
device_id | int | Which device recorded the event |
user_id | int | Who accessed |
remarks | text | Optional (e.g. entry / exit) |
timestamp | datetime | UTC event time (shown local) |
updated_at · deleted | timestamp · tinyint | Audit + soft delete |
ℹ️
Locked Accounts / Active Sessions has no dedicated table. The Locked Accounts tab
reads the failed-attempt columns on users (disable_login,
login_attempts, last_login_attempts); the Active Sessions tab
reads the core session store (ci_sessions) through the core session helper.
Permission keys
| Key | Roles-editor group / action | Style |
offsite_access | Security: Offsite Access / Access | Dropdown (all / specific) |
offsite_access_create · _update · _delete | Security: Offsite Access / Create · Edit · Remove | Child |
locked_accounts | Security: Locked Accounts / View | Simple (no children) |
active_sessions | Security: Active Sessions / Manage | Module-level |
active_sessions_create · _update · _delete | Security: Active Sessions / Create · Edit · Remove | Child |
access_logs | Security: Access Logs / Enabled | Module-level |
access_logs_create · _update · _delete | Security: Access Logs / Create · Edit · Remove | Child |
Not owned here: staff_support (Staffing) and api_clients
(Security: API Clients) remain core-owned; the core IP-restriction block event
offsite_access:ip_security is emitted by core middleware, not this module.
Settings & menu
| Setting | Role |
module_security | Umbrella, seeded on, can_disable=false |
module_offsite_access | Sub-toggle for the Offsite Access item |
module_access | Sub-toggle for the Access Logs item |
Menu entries (config/menu.php): Offsite Access (fa-globe) ·
Locked Accounts (fa-shield) · Access Logs (fa-history),
all under the coalesced Security header (default_menu.php, position 160).
Audit-log events
Keyed action:component in config/system_logs.php, merged into the
core audit-log config. Written on every sensitive mutation.
| Event key | Severity | Meaning |
created:offsite_access | warning | Offsite window granted |
updated:offsite_access | warning | Offsite window updated |
deleted:offsite_access | warning | Offsite window revoked |
unlocked:locked_account | warning | Account unlocked (attempts cleared) |
logout:active_session | warning | All sessions terminated for a user |
deleted:active_session | warning | Single session terminated |
created:access_device | info | Device registered |
updated:access_device | info | Device updated |
deleted:access_device | warning | Device deleted |
rotated_secret:access_device | critical | Device API secret regenerated |
created:access_device_category | info | Category created |
updated:access_device_category | info | Category updated |
deleted:access_device_category | warning | Category deleted |
deleted:access_log | warning | Access log entry deleted |
Next steps