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

Keeps a master site that masters can sign in on.

Masters sign in on the master site's web pages and nowhere else, so each of these would lock every
master out with one click, and is refused:

- switching off, archiving, deleting or unsetting the master site;
- making the master site API-only through an edit;
- moving the flag to a site that is switched off or API-only;
- making a second master by creating or editing another site with the flag: `:set_as_master` is
  what moves it.

Making another site master moves the flag, after which the old one can be changed.

    validate MasterSiteStays                         # :deactivate, :destroy, :permanent_destroy, :unset_as_master
    validate {MasterSiteStays, on: :update}          # :update
    validate {MasterSiteStays, on: :create}          # :create
    validate {MasterSiteStays, on: :set_as_master}   # :set_as_master

---

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