The cell.moderation read rules, in pure and SQL form side by side.
moderation is null or one of the three markers below: the create
authorizer's verdict and cell_moderate write nothing else, and CellJson
refuses any other on the wire. Each rule names the markers it admits.
Audience admission — cell_moderation_admits_audience and
cell_moderation_admits_audience_sql: unmoderated (null) or 'approved'.
A cell's effective audience is its visibility (or grants) and its
admission, so the public and grant read arms of can_view_cell require it,
as do the editor grant arm of can_edit_cell and the matching arms of
query_cell_list (general and shared_with shapes). The owner and
global-admin arms don't: an author keeps reading and editing their own
pending or rejected contribution, and an admin reads everything.
Stewardship — cell_moderation_is_stewardable and
cell_moderation_is_stewardable_sql: exactly 'pending' or 'rejected', the
states in which the governing root's manager reads a contribution its
audience can't (can_steward_cell).
The pure and SQL forms are written once each here, next to each other, over
the same literal constants; every predicate and query composes them rather
than restating the rule. Twin of the Rust fuz_cell::cell_moderation.