# `MishkaCmsCore.Accounts.Changes.EnforceMasterEmailSeparation`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/accounts/__changes/enforce_master_email_separation.ex#L5)

Refuses a master an address a site's account already holds.

A user created with no site is a master. Such a creation is refused, with the address in the
error, when any site's account holds that email.

A site's own registration is not checked against the master accounts. A site signs in, resets and
registers only its own accounts, so on a site a master's address is one nobody there holds and
registers as one; refusing it would tell a stranger on that site that a master holds it.

The check runs as a before-action hook, with `Ash.exists?/2`, so it reads no account.

    change {MishkaCmsCore.Accounts.Changes.EnforceMasterEmailSeparation, []}

# `change`

Adds the check to a creation that makes a master.

## Returns
The changeset, with a before-action hook that adds an error on `:email` when a site's account
holds the address of a master being created.

---

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