What File Storage is (in one minute)
File Storage is a Google-Drive-style workspace built into ERPat. You store operational files in folders and team spaces, keep a full version history, share controlled links, collect files through upload requests, and recover anything you trash — all without leaving ERPat and all under ERPat's permissions, audit trail, and multi-tenant isolation.
Under the hood it is a logical layer over ERPat's existing shared file registry (general_files). It manages only its own logical files and is deliberately blind to files that belong to other modules — profile photos, payslips, and ticket attachments never appear here. That isolation is by construction, not a filter you have to remember to switch on.
The physical bytes reuse ERPat's normal local / AWS S3 storage pipeline: objects are private and served through short-lived signed URLs.
Who it's for
| Role | What they get |
|---|---|
| Any staff member | A personal My Files area to upload, organize, preview, and download work files. |
| Team managers | Team Spaces for a department, plus controlled internal and external sharing. |
| Administrators / compliance owners | A separate Governance console for policies, upload quarantine, legal holds, and a risk dashboard. |
This page covers the two people who make it live: the admin who enables it and the brand-new staff user taking their first tour. Day-to-day sharing, spaces, and requests are covered in Daily Operations.
Setup — for the admin
Four steps take File Storage from installed to usable. Steps 1–3 are required; step 4 is optional.
1. Enable the module
Turn the module on in either of two ways:
- Go to Settings → Manage Modules and enable File Storage, or
- Set the module setting
module_file_storage=1.
Once enabled, a Storage entry appears in the left menu. Because File Storage is multi-tenant, everything lives in the tenant database and there is no tenant_id column — each tenant simply has its own data.
2. Run the module migrations
Create the module's tables (spaces, nodes, versions, ACL entries, sessions, activity, favorites, comments, share links, legal holds, and the reference ledger):
php erpat migrate:modules
3. Assign the permissions
Grant access through ERPat's Roles editor. file_storage is the base permission — without it the Storage menu and screens are hidden. The rest scope what a user can do:
| Permission | Grants |
|---|---|
file_storage | Base access to the workspace (see My Files, Recent, Starred, Trash). |
file_storage_create / _update / _delete | Upload & create folders / rename & move / trash items. |
file_storage_share_internal | Share files and folders with coworkers. |
file_storage_share_external | Create external share links (expiry, password, OTP). |
file_storage_manage_permissions | Set who can do what on a file, folder, or space. |
file_storage_create_space / _manage_space | Create a Team Space / administer its members and settings. |
file_storage_create_file_request | Create upload-only file requests. |
A set of high-risk governance permissions is kept separate and should go only to compliance owners: file_storage_governance_view_activity, _manage_quarantine, _manage_policies, _legal_hold, and _purge. These reach the Governance console — see Administration.
file_storage_governance_purge sparingly. Permanent purge is guarded (see the notes at the end of this page), but it is the one action that can remove bytes for good.4. Optional — policies and demo data
Two optional finishing touches:
- Set upload / retention policies in Governance → Policies (the purpose-policy registry). Sensible defaults apply until you change them.
- Load sample content to explore the screens:
php erpat db:seed FileStorageDemo
Your first tour — My Files
Once the module is on and you hold file_storage, open Storage from the left menu. The menu has My Files (a single page with lazy tabs — My FilesShared with MeRecentStarredTrashActivity — that never reloads as you switch between them) and Team Spaces, which is its own page. Start on My Files.
Upload a file
Drag a file onto the My Files area, or use the Upload button. The file is checked on the way in using ERPat's existing extension, MIME, and magic-byte validation, then stored through the normal local / S3 pipeline. Each upload becomes a logical file (a node) with an immutable first version.
Make a folder
Create a folder to organize your work, then drag files into it (or upload directly inside it). Folders can be nested, and any access you're granted on a folder is inherited by everything inside it — you don't set permissions file by file.
Preview and download
Click a file to preview it in place. To pull a copy to your computer, use Download — File Storage hands your browser a private, short-lived signed URL rather than a public link, so the file stays protected.
Star what matters
Click the star on any file or folder to add it to your Starred tab — a personal shortcut list that's just for you. Your Recent tab fills in automatically as you work, so you can jump back to what you touched last.
Trash and restore
Deleting is soft-delete first: items move to the Trash tab and can be restored. Nothing is destroyed immediately, so an accidental delete is recoverable. Permanent removal is a separate, governed step handled by administrators — not something a normal delete triggers.
Where sharing and team spaces live
This tour keeps you inside your personal My Files. When you're ready to collaborate:
- Team Spaces — tenant-owned shared areas (each needs at least two managers) whose membership can sync with a department. Open Team Spaces from the left menu — its own page, with every space listed down the left and the selected space’s folders and files beside it.
- Shared with Me — files others have granted you, whether directly, by group, by department, or tenant-wide. Open the Shared with Me tab.
- Internal & external sharing, comments, versions, and file requests — all covered step by step in Daily Operations.
Good to know before you start
| Point | What it means for you |
|---|---|
| Isolation by construction | File Storage only ever shows its own files. Other modules' files (avatars, payslips, attachments) are invisible here. |
| Versions are immutable | Uploading a new version keeps the old one in history — nothing is overwritten. |
| Soft-delete first | A delete is recoverable from Trash; only administrators can permanently purge. |
| Reference-aware, fail-closed purge | A permanent purge is blocked while a file is still referenced, is a current version, is within retention, or is under a legal hold. |
| Upload validation, not virus scanning | Intake reuses ERPat's extension / MIME / magic-byte checks. There is a pluggable scanner hook, but a live AV/CDR engine is a future integration and is not enabled today. |