# `MishkaDocument.Resources.Helpers.TenantSiteFilter`
[🔗](https://github.com/mishka-group/mishka_document/blob/v0.0.1/lib/mishka_document/resources/__helpers/tenant_site_filter.ex#L5)

Ash preparation that filters event logs by the actor's site_id.

EventLog stores site_id inside JSONB metadata/data fields rather than
as a top-level column, so standard Ash multitenancy doesn't apply.
This preparation reads the actor's site_id and applies a fragment filter.

- Master users (site_id: nil) see all events — no filter applied.
- Tenant users see only events matching their site_id in metadata or data,
  AND only events created by system (no actor) or by tenant users (not master users).
- Anything else, a missing actor included, sees no event.

# `init`

# `supports`

# `temporal_safe?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
