# `MishkaGervaz.Form.Entities.Access`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/form/entities/access.ex#L1)

Per-mode (or global) access gate inside the `source` block.

`access` declarations live alongside `actor_key` and `master_check`
inside `MishkaGervaz.Form.Dsl.Source`. Each entry decides whether a
given form mode (`:create` or `:update`) is reachable for the current
user.

Three calling styles are supported:

    # Style A — per-mode with keyword opts
    access :create, restricted: true

    # Style B — per-mode with condition function
    access :create, fn state -> state.master_user? end

    # Style C — global gate (`fn mode, state -> bool` in the mode slot)
    access fn mode, state -> mode == :update or state.master_user? end

Style C is the catch-all: it runs for every mode and is useful when
you want one rule covering both `:create` and `:update`.

See `MishkaGervaz.Form.Dsl.Source` for the surrounding section.

# `t`

```elixir
@type t() :: %MishkaGervaz.Form.Entities.Access{
  __identifier__: term(),
  __spark_metadata__: map() | nil,
  condition: (map() -&gt; boolean()) | (atom(), map() -&gt; boolean()) | nil,
  mode: :create | :update | (atom(), map() -&gt; boolean()),
  restricted: boolean()
}
```

# `transform`

---

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