# `AshVault.DecryptFor`
[🔗](https://github.com/jakeschurch/ash_vault/blob/main/lib/ash_vault/decrypt_for.ex#L1)

Evaluates an `encrypt ..., decrypt_for: [...]` list against an actor.

Entries:

  * an `Ash.Policy.SimpleCheck` module — `match?(actor, context, [])`
  * `{check, opts}` — the same, with `opts` passed to the check
  * `{check, only: [action_name]}` (`:only` may be combined with check opts) — matches
    only on those actions. On the decrypt calculation, where no action is known, such
    an entry never matches.
  * `&Mod.fun/1` — a remote actor predicate (the DSL cannot hold anonymous functions)

A `nil` actor never matches. Unset (`nil`) `decrypt_for` admits everyone.

Read callbacks supply normalized tenant, resource, field, phase and source context.
`:action` is always derived from the explicit action argument, never from context.
Three-argument callers retain the original action-only context.

# `entry`

```elixir
@type entry() :: module() | {module(), keyword()} | (term() -&gt; boolean())
```

# `allowed?`

```elixir
@spec allowed?([entry()] | nil, term(), term(), map()) :: boolean()
```

Whether `actor` may have the field decrypted on `action` (`nil` when unknown).

---

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