MishkaCmsCore. Runtime. Resources. Actions. RestoreVersion
(Mishka CMS Core v0.0.1)
Copy Markdown
View Source
The body of a versioned resource's :restore_version_api (a site's own call) and
:master_restore_version (a master's) generic actions: read the record, refuse what may not be
restored, check that the version is one of THIS record's, and run the resource's :restore_version
update with the record's own site as the tenant.
The outer action is authorized by the resource's policies; the reads and the update here run as the system, so the checks below are the whole of what stands between a caller and the record.
Options
:resourceand:version— the resource and its AshPaperTrail version resource. The version resource must have a:get_anyread, and the resource a:restore_versionupdate.:read— the read action that finds the record::readfor a site's call,:master_getfor a master's,:get_anyfor a resource that may be global.:tenant_read?— read in the tenant ofSiteWithGlobals.acting_site/1(a site's call on a resource that is never global).:global?— a site's call on a resource that may be global: a global record is not found by a caller with no site, and may not be restored by a site (:globalwords the refusal).:archivedand:foreign— the refusals for an archived record and for a version of another record, written withdgettext_noop("errors", …)where the action is declared.
A call with no site, or on another site's record, finds nothing.