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

Refuses a media folder put inside itself, or inside one of its own subfolders.

Either would cut the folder and everything under it off from the top level, with no way back
through the library. Asked only when an existing folder's `parent_id` changes: a new folder has
nothing under it yet.

The folders above the new parent are read as the action's actor, one level at a time — see
`MishkaCmsCore.Runtime.MediaCategory.trail/2`. When they cannot be read, the move is refused
rather than let through unchecked.

Each refusal is on `:parent_id`, in the `errors` domain. Whether the parent is a live folder of the
same site is `MishkaCmsCore.Runtime.Resources.Validations.SameSiteReference`'s check.

---

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