Skip to main content
Document permissions (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 with permission_key value document.{type}, three permissions are created:
SuffixActionChecked By
.uploadUpload a document of this typeDocumentPermissionHelper::canUpload()
.readView/download a document of this typeDocumentPermissionHelper::canRead()
.deleteDelete a document of this typeDocumentPermissionHelper::canDelete()

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.
Document TypeUpload KeyRead KeyDelete Key
Go Ahead Instructiondocument.go_ahead_instruction.uploaddocument.go_ahead_instruction.readdocument.go_ahead_instruction.delete
Purchase Orderdocument.purchase_order.uploaddocument.purchase_order.readdocument.purchase_order.delete
Works Orderdocument.works_order.uploaddocument.works_order.readdocument.works_order.delete
EICR Certificatedocument.eicr_certificate.uploaddocument.eicr_certificate.readdocument.eicr_certificate.delete
PAT Test Certificatedocument.pat_test_certificate.uploaddocument.pat_test_certificate.readdocument.pat_test_certificate.delete
LRA Certificatedocument.lra_certificate.uploaddocument.lra_certificate.readdocument.lra_certificate.delete
GSC Certificatedocument.gsc_certificate.uploaddocument.gsc_certificate.readdocument.gsc_certificate.delete
Warning Noticedocument.warning_notice.uploaddocument.warning_notice.readdocument.warning_notice.delete
Floor Plandocument.floor_plan.uploaddocument.floor_plan.readdocument.floor_plan.delete
Deposit Invoicedocument.deposit_invoice.uploaddocument.deposit_invoice.readdocument.deposit_invoice.delete
Invoicedocument.invoice.uploaddocument.invoice.readdocument.invoice.delete
Quotedocument.quote.uploaddocument.quote.readdocument.quote.delete
Cleaning Requirementsdocument.cleaning_requirements.uploaddocument.cleaning_requirements.readdocument.cleaning_requirements.delete
Energy Performance Certificatedocument.energy_performance_certificate.uploaddocument.energy_performance_certificate.readdocument.energy_performance_certificate.delete
Contractors Quotedocument.contractors_quote.uploaddocument.contractors_quote.readdocument.contractors_quote.delete
Total: 45 permissions (15 document types × 3 actions each)

Adding New Document Types

When a new document type is created via Settings → Documents:
  1. A row is inserted into job_file_types with a permission_key (e.g. document.gas_safety_record)
  2. Three new permissions become immediately available: .upload, .read, .delete
  3. Assign the new permissions to the appropriate roles via Settings → Staff Permissions
  4. No deployment or code change is needed — the system reads document types from the database at runtime