# `MishkaGervaz.Form.Dsl.Source`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/form/dsl/source.ex#L1)

Source section — action mapping, preloading, actor resolution, and
per-mode access control.

Tells the form which Ash actions to call for each mode (`create`,
`update`, `read`), what relationships to preload for master vs. tenant
users, and who counts as a master user. Mirrors the table-side
`source` section.

## Example

    source do
      actor_key :current_user
      master_check fn user -> user && user.role == :admin end

      actions do
        create {:master_create, :create}
        update {:master_update, :update}
        read   {:master_get, :read}
      end

      preload do
        always [:user]
        master [:comments, master_category: :category]
        tenant tenant_category: :category
      end
    end

## Sub-sections and entities

  * `actions` — `create` / `update` / `read`. Atom (used for both
    master and tenant) or `{master_action, tenant_action}` tuple. The
    action used at runtime is selected by `master_check`.

  * `preload` — three-tier (`always` / `master` / `tenant`). Each list
    accepts atoms or `{source, alias}` tuples. The relationship's read
    action must NOT have `pagination required?: true` — preloads do
    not pass pagination params and `LimitRequired` will be raised at
    runtime.

  * `access` — entity gating individual modes by role. See
    `MishkaGervaz.Form.Entities.Access`.

## Inheritance

`actor_key`, `master_check`, and `actions` can be set at the domain
level (see `MishkaGervaz.Form.Dsl.DomainDefaults`); resource-level
values override them.

# `section`

Returns the source section definition with nested actions and preload sections.

---

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