User_document_statuses
Status-only view of user documents for compliance rollups
Read-only view over Documents rows where user_id is set. It exposes validity and approval state without uri, size_bytes, or identifier, so roles can see whether a teammate is compliant without being able to open the files.
| Column Name | Data Type | Source |
|---|---|---|
| id | bigint | documents.id |
| user_id | uuid | documents.user_id |
| template_id | bigint | documents.template_id |
| valid_from | timestamp with time zone | documents.valid_from |
| valid_to | timestamp with time zone | documents.valid_to |
| is_approved | boolean | documents.is_approved |
| approved_at | timestamp with time zone | documents.approved_at |
| lifecycle | public.entity_lifecycle | documents.lifecycle |
| created_at | timestamp with time zone | documents.created_at |
Security
Security-barrier view owned by postgres (not security_invoker); the access predicate is inlined in the view definition.
| Operation | Ability key | Other paths |
|---|---|---|
| SELECT | user_documents.status.read or user_documents.read in a herd the document owner is active in | Document owner; platform superadmin |
Writes are not possible through the view.
Realtime
{herd_id}-user_document_statuses broadcasts the same sanitized columns as
this view. The private topic accepts either user_documents.status.read or
user_documents.read; the existing {herd_id}-user_documents topic continues
to require full document read access and carries the document row.