document.*) are dynamic — they are generated at runtime from the job_file_types database table. Each document type has a permission_key column, and the system appends .upload, .read, or .delete to build the final permission key.
When a new document type is created in Settings → Documents, a new set of three permissions is automatically available for assignment. No code changes are required.
Permission pattern
For each document type withpermission_key value document.{type}, three permissions are created:
Current document types
The following document types are currently configured. All permissions below are active — they are checked at runtime when a user attempts to upload, view, or delete a document.Total: 45 permissions (15 document types × 3 actions each)
Adding new document types
When a new document type is created via Settings → Documents:- A row is inserted into
job_file_typeswith apermission_key(e.g.document.gas_safety_record) - Three new permissions become immediately available:
.upload,.read,.delete - Assign the new permissions to the appropriate roles via Settings → Staff Permissions
- No deployment or code change is needed — the system reads document types from the database at runtime