# `MishkaCmsCore.Runtime.Resources.Validations.TenantOwnsRecord`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/runtime/resources/__validations/tenant_owns_record.ex#L5)

Refuses a site's change to a row that belongs to no site, or to another one.

On a `global? true` resource a site can read the global rows and the rows of its own site, and
nothing in Ash stops it writing to either of the others. The row's CURRENT `site_id` is compared
with the tenant of the action: a global row is refused with `:global`, a row of another site with
`:foreign`. An action with no tenant (a master's) passes, and so does a row of the tenant's own
site.

## Options

- `:global` - Required. The message for a global row.
- `:foreign` - Required. The message for a row of another site.

## Usage

    validate {MishkaCmsCore.Runtime.Resources.Validations.TenantOwnsRecord,
              global: dgettext_noop("errors", "Cannot modify global layout."),
              foreign: dgettext_noop("errors", "Cannot modify layout from another site.")}

---

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