class ModelPrivate implements ExtenderInterface
Some models, in particular Discussion and CommentPost, are intended to support a "private" mode, wherein they aren't visible unless some criteria is met. This can be used to implement anything from private discussions to post approvals.
When a model is saved, any "privacy checkers" registered for it will
be run. If any privacy checkers return
of that model instance will be set to
true. Otherwise, it will be set to
false. Accordingly, this is only available for models with an
In Flarum core, the Discussion and CommentPost models come with private support.
Core also contains visibility scopers that hide instances of these models
is_private = true from queries. Extensions can register custom scopers
for these classes with the
viewPrivate ability to grant access to view some
private instances under some conditions.