Skip to content

history.visibility ​

Overview ​

Which history events a requester may read.

The rule has two halves. Events on the requested object are visible, because the endpoint has already authorized that object. Events on a related row follow that row: visible while the requester can read it, and after deletion only when the model's visibility never depended on the row in the first place.

Every part of the rule is a query predicate, so the filter runs before pagination and a hidden event leaves no trace in a page count.

Every tracked model whose events can reference model, excluding the model itself.

The schema decides this list, so the number of subqueries the predicate builds depends on the shape of the models rather than on how much history exists.

related_tracked_models(model)

NameTypeRequiredDefaultDescription
modelyes

server/vueda/history/visibility.py:43

self_predicate ​

A predicate that selects the events written to the requested object itself.

Signature ​

self_predicate(instance)

Parameters ​

NameTypeRequiredDefaultDescription
instanceyes

Source ​

server/vueda/history/visibility.py:57

visibility_predicate ​

A predicate over the aggregate event columns for one requested object and one requester.

Signature ​

visibility_predicate(instance, user)

Parameters ​

NameTypeRequiredDefaultDescription
instanceyes
useryes

Source ​

server/vueda/history/visibility.py:62

Source ​

server/vueda/history/visibility.py