MishkaCmsCore.Runtime.Resources.Validations.MasterSiteStays (Mishka CMS Core v0.0.1)

Copy Markdown View Source

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